1

I've used a command similar to this to rsync files from macOS to Linux:

rsync -avz <ip-address>:/Backup/ Backup/

The folder Backup/ was previously copied from the same machine using scp, with no files changed. I thought that rsync would be a noop, but it started to overwrite all files (probably, because of different timestamps), causing a lot of disk writes. I've tried the same command with --size-only and it finished almost instantly. Does rsync completely overwrite the files that have different timestamps (i.e. not checking the difference)? Does it depend on the size of the files?

  • 2
    Use -i instead of -v to see why a file transfers. Read the manual about --itemize-changes. – Kusalananda Nov 3 '18 at 21:59
  • @Kusalananda So if I see something like >f..t...... /path/to/file when using -i, does it mean that the file is completely overwritten? Why does rsync do it if only modification time differs? – Eugene Yarmash Nov 4 '18 at 20:56
  • Then it applies its delta algorithm to transfer the bits of the file that has changed. If no data in the file has changed, rsync still has to send the checksums for each block in the file across to verify that this is in fact the case. The block size is determined from the size of the file as mentioned in the documentation for -B. Also try running with --stats to get final stats for the transfer. Calculating the checksums for the delta algorithm involves reading the complete file. – Kusalananda Nov 4 '18 at 21:15
-1

read the fine manual of rsync:

       It is famous  for  its
       delta-transfer  algorithm,  which  reduces the amount of data sent over
       the network by sending only the differences between  the  source  files
       and  the  existing  files in the destination.

I think you're getting read i/o, not write. Are you sure in rsync overwrite the files and not only scanning the content of them?

  • I don't think this quote illustrates what you want it to, since regardless of what goes over the network traffic it could still rewrite the files locally (which it has to do when there are changes). – Michael Homer Nov 3 '18 at 21:24
  • Yes, I'm sure (I checked with iotop). I know about the delta-transfer algoritm, the question was why it didn't work. – Eugene Yarmash Nov 3 '18 at 21:43
  • Because the files are really different? Check them with md5sum. – Ipor Sircer Nov 3 '18 at 21:44
  • No, that's not the case either. – Eugene Yarmash Nov 3 '18 at 21:53
  • Then fill a bugreport. – Ipor Sircer Nov 3 '18 at 22:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.