Moved files

Matt McCutchen matt at
Thu Sep 4 17:06:11 GMT 2008

On Thu, 2008-09-04 at 17:52 +0200, Julian Pace Ross wrote:
> Is it possible to perform the following for moved files (i.e. files that 
> already exist on destination, but are moved into a different or new dir on 
> the source):
> - generate filelist including deleted files (without deleting)
> - during transfer, for each *new* file, check against above list for 
> deletions.
> - If there is a match, and size is similar, try using that file as a basis 
> for transfer.
> - finally delete all... (like --delete-after)
> All this would be sort of related to the --fuzzy option, but for moved files 
> instead of renamed. This would be especially useful for scripts that deal 
> with a few large files that sometimes change place, are dumped into archive 
> dirs etc...

The --detect-renamed option added by detect-renamed.diff does
essentially this, except that it checks each deleted file against the
list of new files rather than vice versa.  This technique was probably
easier to implement before incremental recursion because a full list of
the source was available, but it fails for moves into directories that
haven't yet been created and doesn't extend nicely to detecting copies.

I would like to have an implementation that checks each new file against
the list of existing destination files; I'm not sure whether it would be
better to generate the list first (as you described) or postpone new
transfers to a second pass after the whole destination is scanned (as
the current implementation does).  Neither technique would interfere
with the use of incremental recursion on the source.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
Url :

More information about the rsync mailing list