how to take least risk on rsync dir

Dave Dykstra dwd at bell-labs.com
Fri May 3 14:37:02 EST 2002


On Tue, Apr 16, 2002 at 05:15:45PM +0800, Patrick Hsieh wrote:
> Hello list,
> 
> When rsync dir_A to dir_B, I hope I wont make any change to the original
> dir_B unless the rsync procedure end withour errors, therefore, I hope
> there's somethig like
> 
> rsync -av dir_A dir_B_tmp && \
> mv dir_B dir_B.bkup &&
> mv dir_B_tmp dir_B
> 
> This small script can ensure the minimal change time between 2 versions
> of archive. Is this built in the native rsync function? Do I have to
> write scripts myself?


You'd have to write a script like that yourself, but you'll want to use a
new option which should go into the next release of rsync called
--link-dest which will comparison against the files in dir_B and hard link
in all the ones that haven't changed.  Meanwhile the --compare-dest option
does almost what you want but doesn't do the linking in of the unchanged
files.  See the rsync man page for details.

- Dave Dykstra
be able to do comparisons against existing the existing 




More information about the rsync mailing list