rsync directory complete but some files md5sum is different

0

I'm using rsync to copy a directory from host A to host B. After the rsync is completed successfully, I check the files with the directory and find that some files' md5sum is different but the timestamp is the same. Can anyone tell me why?

**rsync info:**
rsync  version 2.6.3  protocol version 28
Copyright (C) 1996-2004 by Andrew Tridgell and others
<http://rsync.samba.org/>
Capabilities: 64-bit files, socketpairs, hard links, symlinks, batchfiles, 
              inplace, IPv6, 64-bit system inums, 64-bit internal inums

rsync comes with ABSOLUTELY NO WARRANTY.  This is free software, and you
are welcome to redistribute it under certain conditions.  See the GNU
General Public Licence for details.

**rsync option**
rsync -avP DIR HOSTB:foo/

After I found out this difference, I used the Linux touch command to update all the files within this directory and find out that rsync still syncs the files which have the same MD5 value.

This problem has bothered me for quite a long time; any help or suggestions?

saYu

Posted 2011-10-20T01:24:17.083

Reputation: 1

1rsync doesn't use md5 to test for differences, it uses timestamps and size. If the source and destinations were the same size and the modification dates were older or the same than the destination, then they wouldn't copy. Would that account for it? – Paul – 2011-10-20T02:42:43.897

Answers

4

If you want rsync to detect changed files by checksumming, you have to use the -c/--checksum option. If this option is not set, rsync just compares file size and time of last modification.

Speckinius Flecksis

Posted 2011-10-20T01:24:17.083

Reputation: 313