"wget --mirror" Alternative
I'm looking for an alternative to using this, it doesn't have to use FTP, but it should provide the same functionality as the "--mirror" option of wget where it only downloads new and changed files.
wget --mirror --preserve-permissions --directory-prefix=/hdd2/website-backups --exclude-directories=special,stats --ftp-user=user --ftp-password=pass ftp://ftp.domain.com
Currently the above command is how a remote site is being backed up every few days via cron job on a home server. The remote site has moved to a new host with SSH available and I've already got public/private keys setup for SSH. Now I would like to use something a little more secure than wget/ftp for the automated backup, but since this site has a lot of image files most of which will not change, I don't really want to zip up the entire documentRoot and download it every time.
rsync is the standard utility for this:
rsync -avz -e ssh source/ user@destServer:/dest/
- a For archive, keeps permissions, type stamps, etc.
- v for verbose
- e ssh , use over ssh
- z for compression, if you want that. It won't try to re-compress archive (zip) files.
rsync generally comes with Linux distributions. It also meets your requirement of not transferring things that have not changed.