rsync copies unmodified files between different file systems

I try to synchronize files between two machines using rsync, but it seems to copy all the files regardless file modification time. Two consecutive call of the command produces the same results, so it is clearly broken.

The command in question is:

rsync -r local/path user@host:/remote/path -v

The local file system is ext4 while the remote is ext3. I suspect the issue lies here, as I had similar problems when I tried to synchronize files between the same ext3 system and an NTFS drive. Converting the latter to ext3 solved the problem.

I cannot resort to conversion this time. Does anyone know the exact source of the problem and any possible solution?


rsync by default does not copy files based on their modification time and size.

If you are not using -t in the command line, rsync will not preserve the modification times and the size + time check will of course fail.

There is also a good chance that the timestamp precision of your differing filesystems is causing the problem - ext4 supports microseconds while ext3 is limited to seconds.

Try adding a --modify-window=1 to the command line, to tell rsync to treat the timestamps with one second precision.

Alternatively you can give it a -c to force checksumming of the files, but this will be of course much slower than the mtime + size check, even if it does save you the bandwidth.