"intelligent" rsync scripts?
wayned at samba.org
Thu Nov 10 19:30:49 GMT 2005
On Thu, Nov 10, 2005 at 10:32:50AM -0500, Chris Shoemaker wrote:
> If the original file changes, then so will the hard link.
No -- an rsync update creates a temporary file, and that file gets
renamed into place, breaking any hard-link that this new code creates.
(The only exception to this update method is when --inplace is enabled,
and I made this conflict with the new --detect-rename option.)
> I think the don't-really-delete mode for delete-during is sufficient.
Sure, if we forced --delete-before to be --delete-during, that would be
sufficient for making this work. However, having the scan take place
during the --delete-before handling doesn't add complexity to the code
(the extra complexity is needed for allowing the scan-as-we-update
handling with its potential to delay some missing-file updates).
So, if the user wants a --delete-before scan, I figure we might as well
allow it and use its disk I/O for our benefit, and it does ensure that
the entire destination area is scanned before we start the updating,
removing the need to delay any updates.
> If --detect-renames hardlinks the deleted files it doesn't matter that
> the orginals are deleted before transfer; hard drive space is not
True, but only for correlated files. Any extraneous files will still be
deleted before the transfer. This shouldn't be any worse in disk-space
use than the alternative of not allowing a delete-before pass.
> Oh, because the match-search for non-missing files is not delayed in
> the --delete-during scan, right?
Exactly. My text might not have made it clear that this non-missing
handling will always work for files in a single directory (such as
log-dir rotations) as well as files found in the already-scanned dirs
prior to getting to the current directory.
> So, will this be in 2.6.7?
It has a good chance of making it. It still needs some cleanup and
testing, some of which I've just done: e.g. I've added support for
checksum matching (instead of mod-time matching) when --checksum is
enabled. The aforementioned patch has been updated with the latest
More information about the rsync