We host our Korora Project ISO images on SourceForge and I (naturally) use rsync to move them there (slowly, at 100kb/sec). Sometimes though the connection drops off and that’s OK because rsync picks up where it left off.
However occasionally the ISO ends up with the wrong checksum, so something went wrong in the transfer. No amount of re-rsyncing seems to fix this up because by default it uses file size and timestamps to check whether it should skip existing files.
Fortunately, I don’t need to re-send the whole file again as rsync can perform a delta transfer instead and only send the small difference. Yay!
The way I do this is by telling rsync to use checksum. I also need to do the transfer in-place (rsync normally writes a temporary file, then moves) and not to copy the whole file (the whole-file option disables deltas), something like:
rsync -Pa --checksum --inplace --no-whole-file local.file remote.server:
Here’s a real example:
chris@x220 ~ $ rsync -Pa --checksum --inplace --no-whole-file -e ssh korora-20-i386-cinnamon-live.iso csmart,firstname.lastname@example.org:/home/frs/project/k/ko/kororaproject/20/
sending incremental file list
1,715,470,336 100% 220.87MB/s 0:00:07 (xfr#1, to-chk=0/1)
So rsync just saved me 4 hours of uploading the ISO again. Thanks rsync.