On Wednesday 15 December 2004 06:11 pm, Jon Nelson wrote:
On Wed, 15 Dec 2004, Paul W. Abrahams wrote:
I'm looking for a utility to be used for a disk-to-disk backup that recurses through a directory and does the following for each file and subdirectory:
1. If the backup file exists but the original doesn't, the backup is deleted.
2. If the backup file exists and is as new as the original, no copying is done.
3. If the backup file does not exist, the original is copied to the backup.
I could certainly write a shell script using "find" for doing this, but I wonder if there's some handy-dandy utility around that already does it for me.
man rsync.
You can use it over ssh, too. rsync -e ssh rsync -e 'ssh -l someuser' ....
More specifically, I use: rsync -auvzr -e ssh /path/to/local/dir/ <name of remote machn>:/path/to/backup/dir/ and back up directories nightly. Note the trailing slashes on the above paths. They are important.