rsync fails to sync files

Atte Peltomaki atte.peltomaki at f-secure.com
Tue May 8 12:45:40 GMT 2007


On Tue, May 08, 2007 at 01:07:51PM +0200, Paul Slootman wrote:
> On Tue 08 May 2007, Atte Peltomaki wrote:
> > Source:
> > 
> > md5sum:
> > 2ac4a4ad88da17f49d26c9e578ce5432  somefile.exe
> > sha1sum:
> > eaabb30b716e993be000b89208e2d9f63e78f052  somefile.exe
> > ls -l:
> > -rwxrw----  1 user group 109819105 Apr  2 10:48 somefile.exe*
> > 
> > Destination:
> > 
> > md5sum:
> > 72c116866a75f859a19a150216768e52  somefile.exe
> > sha1sum:
> > 33b7d91fc6bd2a5bff292258c7d6eeb7db0aec8a  somefile.exe
> > ls -l:
> > -rwxrw----  1 user group 109819105 2007-04-02 10:48 somefile.exe*
> 
> The files apparently both have the same size, timestamp, and other
> attributes.  Only the contents differ.
> 
> You did not ask rsync to checksum the files...
> 
> > What is the exact algorithm rsync uses to determien wether a file is up
> > to date or not? 
> 
> Hmmm.... I thought this would have been in the manpage, but it's not
> spelled out apparently.
> Rsync by default compares size and mtime to determine whether a file
> needs to be transferred. (I think the other attributes such as owner,
> permissions are only updated, but don't necessarily incur a contents
> sync, although I confess I'm not absolutely sure.)
> 
> You need to supply the --checksum option if you want to make sure that
> the contents are indeed identical. This is normally not done as that
> would cause a massive IO load; cases that size and timestamp are
> identical but not the contents don't usually happen...

The manual is indeed not very clear about the subject:

"""
       The rsync remote-update protocol allows rsync to transfer just the dif-
       ferences between two sets of files across the network connection, using
       an efficient  checksum-search  algorithm  described  in  the  technical
       report that accompanies this package.
"""

Forgets to say that "efficient checksum-search algorithm" is not enabled
by default *doh*. 

Anyway, thanks for help - using --checksum works, although it's quite
slow. 

-- 
 ____________
 \   ______//     Atte Peltomäki - atte.peltomaki at f-secure.com
  \  \\____        UNIX System Administrator - IT Server Team
   \   __//    F-Secure Corp. PL 24, FIN-00181 Helsinki, Finland
    \  \\     Tel: +358 9 2520 0700,     direct: +358 9 2520 5423   
     \ //                   http://www.f-secure.com
      \/         Integrated Solutions for Enterprise Security


More information about the rsync mailing list