Take the 2-minute tour ×

Say I have hard drives A and B

B is the external backup files. Every week, i'd like to back up A into B, but only moving newer/updated files, removing the necessity to copy over files that have not been altered.

is it possible?

share|improve this question
add comment

2 Answers

up vote 2 down vote accepted

What you are describing is essentially the default behavior of rsync, but your best bet would be to use -a, so your rsync would look like this:

rsync -e ssh -avz --delete-after /path/to/stuff user@slave:/path/to

-e Specifies the files will be sent through SSH
-avz This is a combination of 3 options. The "-a" means archive. This will preserve symlinks, permissions, timestamps, group/owners, and will be recursive. The "v" makes the job verbose. This won't be necessary, but you can see what's happening with the rsync so you know if you've done something wrong. The "z" compresses data to speed up the transfer.
--delete-after Will tell rsync to compare the destination against the source and delete any extraneous files after the rsync has completed. This is a dangerous option, so use with caution.

share|improve this answer
add comment

If you are in linux, use cron to run a shell script that first mounts that drive then does a rsync to it. Do a crontab -e then add below

* * * * 0 script.sh 2>&1 >> scriptLog.log

Runs on the first day of every week, where Sunday = 0, Monday = 1...

P.S. This really wont be a backup as you are only syncing and overwriting the files to B. Backup is termed only when data state X is preserved at time instance T. Where X never changes after T & is always preserved.

share|improve this answer
add comment

Your Answer


