rsync -c -i flags identical files as different

Posted by Scott on Server Fault See other posts from Server Fault or by Scott
Published on 2009-09-09T20:14:50Z Indexed on 2010/06/14 14:23 UTC
Read the original article Hit count: 306

Filed under:
|

My goal: given a list of files on local server, show any differences to the files with the same absolute path on remote server; e.g. compare local /etc/init.d/apache to same file on remote server.

"Difference" for me means different checksum. I don't care about file modification times. I also do not want to sync the files (yet); only show the diffs.

I have rsync 3.0.6 on both local and remote servers, which should be able to do what I want. However, it is claiming that local and remote files, even with identical checksums, are still different.

Here's the command line:

$ rsync --dry-run -avi --checksum --files-from=/home/me/test.txt --rsync-path="cd / && rsync" / me@remote:/

where:

  • "me" = my username; "remote" = remote server hostname
  • current working directory is '/'
  • test.txt contains one line reading "/etc/init.d/apache"
  • OS: Linux 2.6.9

Running cksum on /etc/init.d/apache on both servers yields the same result. The files are the same.

However, rsync output is:

me@remote's password: 
building file list ... done
.d..t...... etc/
cd+++++++++ etc/init.d/
<f+++++++++ etc/init.d/apache

sent 93 bytes  received 21 bytes  20.73 bytes/sec
total size is 2374  speedup is 20.82 (DRY RUN)

The output codes (see http://www.samba.org/ftp/rsync/rsync.html) mean that rsync thinks

  • /etc is identical except for mod time
  • /etc/init.d needs to be changed
  • /etc/init.d/apache will be sent to the remote server

I don't understand how, with --checksum option, and the files having identical checksums, that rsync should think they're different. (I've tried with other files having identical mod times, and those files are not flagged as different.)

I did run this in /, and made sure (AFAIK) that it's run remotely in /, so even relative pathnames will still be correct.

I ran rsync with -avvvi for more debug info, but saw nothing remarkable.

I'm wondering:

  • is rsync still looking at file mod times, even with --checksum?
  • am I somehow not setting up the path(s) right?
  • what am I doing wrong?

© Server Fault or respective owner

Related posts about rsync

Related posts about diff