--fuzzy search over to-be-deleted files to catch moved files and directories

H. Langos henrik-rsync at prak.org
Wed Nov 11 06:32:07 MST 2009

On Wed, Nov 11, 2009 at 12:17:50PM +0100, H. Langos wrote:
> Hi Matt,
> Thank you very much for the quick response!
> On Tue, Nov 10, 2009 at 12:13:09PM -0500, Matt McCutchen wrote:
> > On Tue, 2009-11-10 at 17:55 +0100, H. Langos wrote:
> > > Now the question is, if fuzzy search could be extended to search for
> > > moved files across directory borders. If for example I move pictures
> > > aound to reorganize them in a different directory hierarchy, or if I 
> > > move whole directories around as I reorganize part of my music files.
> > 
> > Consider the --detect-renamed option provided by the maintained patch
> > "detect-renamed.diff".  
> That sounds just like the thing. 
> I applied the patch from git://git.samba.org/rsync-patches.git
> that is tagged v3.0.6 (d64936b9..) and it builds nicely with the debian 
> lenny source package of 3.0.6 .. now I'll have to see how it works.

It does work. It will only show up if you enable -vvv though.

Unfortunately it still does not solve my problem. "--detect-renamed" 
hardlinks when it moves deleted files to its temp directory. But then 
it seems to copy the file to its new location. 

This breaks the space saving property of rsnapshot (hardlinking files that
didn't change since the last snapshot). 

So in order to realy work in my setup one would have to check if the delta
transfer did change any data at all. If it didn't a hardlink would be made
instead of a copy.

> Is there a way to enforce checksum tests for moved files while keeping 
> size+mtime tests for files that didn't get moved/renamed ?

According to the patches documentation the delta-transfer algorithm will
be used for any detected rename. So my data should be safe :-)


More information about the rsync mailing list