--compare-dest weirdness

Henri Shustak henri.shustak at gmail.com
Mon Jul 19 20:40:45 MDT 2010

> interestingly, i tried to see if something was wrong with my statments by doing:
> mkdir ~/rsynctest/dir1
> mkdir ~/rsynctest/dir2
> mkdir ~/rsynctest/dir3
> nano ~/rsynctest/dir1/file1 (wrote the line hello world and saved)
> nano ~/rsynctest/dir1/file2 (wrote the line hello and saved)
> cp ~/rsynctest/dir1/file* ~/rsynctest/dir2/
> checked md5sums of both files in both dirs to ensure they were identical
> the did rsync -rvu --compare-dest=/home/kevin/rsynctest/dir2/
> /home/kevin/rsynctest/dir1/ /home/kevin/rsynctest/dir3/
> the two files from dir1 were copied to dir3, even though identical
> copies, with the same names, existed in dir2.
> i also tried this again with the compare dir relative to the dest dir,
> i.e.: rsync -rvu --compare-dest=../dir2/ /home/kevin/rsynctest/dir1/
> /home/kevin/rsynctest/dir3/ again with same result

I thought about this further and I think the problem you are having is that the modification times are not being preserved and you are not using the --checksum option. 

As such, I suggest that you add the --times or --checksum option and see if that helps. 

I suspect that this will solve your problem. Let me know =:^)

This email is protected by LBackup, an open source backup solution. 
Free as in freedom; LBackup is licensed under the GNU GPL

More information about the rsync mailing list