Problem with rsync-2.6.8 and -c (checksum)

Paul Slootman paul at debian.org
Tue May 23 09:07:51 GMT 2006


On Mon 22 May 2006, Andreas Fehr wrote:
> 
> If added '-c' to the already existing '-a'. Now it looks as follows:
> 
> /opt/rsync/bin/rsync -cav
> --link-dest=/home/user/backup/old
>             /home/user/source 
>             /home/user/backup/new
> 
> 
> I expected, that rsync doesn't care about the timestamp anymore. It 
> should calc the checksum of all the files in the source directory, 
> compares them with the files in the '--link-dest' directory and just 
> copies the files with a different checksum. But there is no change in 
> the behavior of rsync. I get the same result with or without the '-c' 
> option.
> 
> My guess: --checksum does not work on --link-dest. Is this by design?

It does, but not the way you expect it.

The -a also implies -t, so you're telling rsync to preserve timestamps.
The only way it can do that is by creating a new file, as the
--link-dest tree has a different timestamp.

The --checksum will only _increase_ the number of newly created files,
if anything; if you change a file in the source, but do not change its
modification time (e.g. by resetting that after the change) or any other
metadata such as size or ownership, then without --checksum rsync will
be "fooled" into thinking it's the same as the version in the
--link-dest tree, and will link to that. With --checksum rsync will see
that it is in fact different, and will create a new file instead of
linking.


Paul Slootman


More information about the rsync mailing list