--link-dest behavior
Matt McCutchen
matt at mattmccutchen.net
Sat Oct 4 20:32:45 GMT 2008
On Fri, 2008-10-03 at 01:14 -0400, Matthew Monaco wrote:
> I've been thinking about the current behavior of the --link-dest=DIR
> option. In the absence of --delete, ALL members of DIR should be linked
> to the destination (aside from those that are changed). If not, there
> should at least be a --no-link-dest-delete option. (This latter option
> might be better to avoid disrupting the behavior of current rsync commands)
Interesting suggestion. Currently, the meaning of --link-dest=DIR is
somewhere between "use DIR as an optimization" and "regard DIR as the
previous version of the destination", and it is not ideally suited for
either use case. I have proposed splitting it into --link-basis-dir and
--link-dest variants for the two meanings:
https://bugzilla.samba.org/show_bug.cgi?id=5645
The new --link-dest would itemize deletions with respect to the basis
dir when --delete is on, even though nothing is actually being deleted,
as separately proposed here:
https://bugzilla.samba.org/show_bug.cgi?id=5263
And, now that you mention it, I guess the new --link-dest should also
hard-link in files from the basis dir that have no counterpart in the
source when --delete is off.
A currently possible way to get the same result as my hypothetical new
--link-dest is to "cp -al" the basis dir to the destination first and
then rsync to the destination.
Matt
More information about the rsync
mailing list