Mirror a folder from the Internet to local machine

I have a machine in my LAN that runs Ubuntu and I have full access in it.
There is another PC on the Internet that has a public IP eg 3.3.3.3 and it servers as https server and access to it is by username and password. On the remote PC all i have is access through https using username/passwd.

At the moment I'm logging to the ubuntu and using wget to get folders that I want.
I would like to automate the boring stuff and every 1 hour to check if the server has new content compared to the ubuntu's /var/www/html/x3 and /var/www/html/y7 local folders.
The Internet server has as series of folders eg x1, x2,...,xn, y1,y2,...,yn. i do need to get only 2 particular folder and its contents and not the whole server.
If those 2 folders have different content, then download the new content and delete the old ones in the corresponding folder.
It is a one way sync. is there any script that could do the job with cron, please?

I think looking at the man pages of rsync command would be a good start, as rsync is very versatile and may just do the job you want, I used to use it to synchronise /etc/passwd and other changing stuff in clusters...

Hi. Thanks a lot for the quick reply. I thought of rsync, but the only access to the remote PC is through https.
as i see it i need a script that checks the current directory against the remote. if there is difference then wget the new and delete the old ones.

There's only one way synchronizing with wget -m <URL>
which will copy what in server to your local storage. Try
wget --spider .. read its official man; GNU Wget 1.18 Manual