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 passing a combination of options to rsync, such as –checksum (to enable transfer of the file), –in-place (to transfer the file in place as rsync normally writes a temporary file, then moves) and –no-whole-file (which tells rsync to not copy the whole file, but use deltas instead).
This becomes 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,kororaproject@frs.sourceforge.net:/home/frs/project/k/ko/kororaproject/20/
sending incremental file list
korora-20-i386-cinnamon-live.iso
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.