How to emulate rdiff behaviour

Matt McCutchen matt at mattmccutchen.net
Thu May 28 15:32:16 GMT 2009


On Wed, 2009-05-27 at 21:58 +0000, Frank Harmann wrote: 
> i am new to rsync and i want to use rsync to emulate rdiff behaviour
> (because i can't install rdiff on the system).
> What i would like rsync to do is to generate a diff file (like with
> rsync --write-batch) but WITHOUT changing the destination file.

--only-write-batch does that.

> This would allow me to store daily differential updates on the target
> (i think hardlinking would not help me much as the file is changing
> every day) and do a true rsync once a week.
> Or is there a better way to store incremental updates on constantly
> changing files (like VM images). I need to keep disk usage on the
> target as low as possible.

You're right about hard linking.  But if you always generate batch files
with respect to the source file as it existed at the beginning of the
week, you'll duplicate a lot of diff data.  Two alternatives to avoid
the duplication:

- Allow rsync to update the destination file each day, but keep an extra
copy of the file as of the beginning of the week as a starting point
from which to apply batch files for recovery.

- Each day, generate a reverse batch (by running rsync in the reverse
direction with --only-write-batch) and then update the destination file.
To recover, apply reverse batches to the destination file.  rdiff-backup
(http://www.nongnu.org/rdiff-backup/) is another tool that works
essentially this way.

-- 
Matt



More information about the rsync mailing list