Increamental backup

Wayne Davison wayned at
Thu Apr 13 17:15:37 GMT 2006

On Thu, Apr 13, 2006 at 12:44:07PM -0400, Ahmed Ndaula wrote:
> 20 16 * * 5 rsync -avz -e "ssh -i rsync" --compare-dest=Souredirectory
> Destinationdirectory
> Would that script to have increamental back?

The --compare-dest option will only copy files that are different from
those in the specified compare-dest hierarchy into the
Destinationdirectory hierarchy, so that will give you an incremental
backup operation.  Note that the option is relative to the destination
dir, so you probably need to say:


Also, the Sourcedirectory needs to be a complete copy of the files
from the source machine as they existed at the time of the prior copy.
If you just repeated that rsync command without any changes to the
destination hierarchy, more and more changed files would show up in
Destinationdirectory.  If you want to get just the changed files from
the most recent rsync run, you'll need to have moved all the changed
files from prior run out of Destinationdirectory into Sourcedirectory
so that rsync will have an empty destination hierarchy to copy into.

If you're not copying the changed files to another medium (such as
tape), you should consider using --link-dest, which will give you what
appears to be a full backup (on disk), but it will hard-link unchanged
files together with the prior hierarchy to save space.


More information about the rsync mailing list