switch for hardlink behavior on destination

Matt McCutchen matt at mattmccutchen.net
Sun Oct 26 21:03:15 GMT 2008


On Sun, 2008-10-26 at 01:36 -0400, Matthew Monaco wrote:
> Is there a way to control how rsync handles hardlinks on the destination?
> 
> For example: I have two directories on a remote system which each have
> the same hardlink called TestFile.txt
> 
> I use only one folder as the destination and TestFile.txt needs to be
> updated.
> 
> Can I choose to preserve the hardlink or break it and create a new
> TestFile.txt in the destination?

The default behavior is to break the hard link if the file's data
changed but leave it if only attributes changed.  To always break the
hard link, you would need to either copy to a new destination with
--link-dest or use the --no-tweak-hlinked option implemented by my patch
(see https://bugzilla.samba.org/show_bug.cgi?id=4561 ; unfortunately,
not updated recently).  To always leave the hard link intact, use
--inplace.

Matt



More information about the rsync mailing list