I want to use RSYNC for the incremental copy of a folder which has a considerable size. The source (a directory) resides on an External hard disk (as we cannot have a network link between the source and destination) and the destination is a local system. Every week , the HDD is formated and that same directory is re-copied inside the External Hard Disk (it reflects the same data + any changes that has occurred since we last copied the directory into our system). I was wondering whether RSYNC can perform an incremental copy in this particular case. Thanking You
Sure. You can use something similar to:
rsync -av --delete <src> <dst>
The first copy will be slow (all data must be copied), but successive ones will be much faster (only modified/added files will be copied).
--delete switch tell rsync to delete files which are not in
src anymore; using it, you should be able to avoid the regular re-formatting of the external drive.
If you are interested in keeping hystorical/versioned backup, rather then directly using
rsync, give a look at
rsnapshot: it is based on rsync, but adds integrated backup deletion/rotation.
As has already been noted
rsync can be used to make your backups. If you already have a backup,
rsync can be used to apply the incremental changes. It also has features to save changes so you have historical backups using the
--backup and related flags.
There are a number of backup solutions built on top of the
rsync protocol designed to keep historical backups that may be more space efficient. I've been using BackupPC to backup both Linux and Windows systems. You would need to run it manually in your case.