Rsync: --link-dest when target and compare_dir both have file

Michael Rubel mrubel at galcit.caltech.edu
Tue Jun 3 15:39:15 EST 2003


Everyone: apologies for hitting the list twice; when my first message did 
not go through I thought I'd used the wrong From: address.

J.W.:

Thanks very much, this clears it up nicely:

> --link-dest is built on --compare-dest and behaves like
> --compare-dest as indicated in the manpage.
> 
> Observe the description of --compare-dest (ALLCAPS added for
> emphasis):
>               This  option instructs rsync to use DIR on the des­
>               tination machine as an additional directory to com­
>               pare destination files against when doing transfers
>               IF THE FILES ARE MISSING IN THE DESTINATION DIREC­
>               TORY.
> 
> In other words, the files in the --link-dest location will
> only be used if there is no existing file in the
> destination.  The best way to use --link-dest is to have an
> empty destination.
> 
> For a link-dest based rotating backup that reuses directory
> names the best bet is to do a "rm -r $dest; mkdir $dest" or
> to "rsync -a --link-dest=../backup.1 $source temp; mv temp
> backup.0"

I'll make a note on the snapshot page and respond to the person who 
forwarded it to me.

Mike




More information about the rsync mailing list