Short version: To make rsync better at restarting where it left off, add the --inplace
flag. No need to split up large files.
Longer version:
Breaking up the file into smaller ones, transferring each, is a good idea. However you're working too hard. Internally rsync breaks up files into 64k chunks... kind of. There is a way to make rsync
do what you want: add the --inplace
flag.
Let's look at the larger problem you're having: Your internet connection is unreliable and you need a way to get large files sent.
If you use --inplace
flag (which implies --partial
) you'll get the desired result. Every time a transfer gets interrupted, rsync
will leave the files in a state that makes it efficient to continue where it left off the next time you run (the same) rsync
.
Just use --inplace
and run the rsync command multiple times until everything gets copied.
If you are very paranoid, once all the files have copied successfully do one more pass adding the --checksum
(-c
) flag. This will do a very slow byte-by-byte re-check instead of using the file's timestamp to know which files can be skipped. Since all the files were copied properly already, it shouldn't find any more work to do. That said, I do this sometimes just to have peace of mind. You don't want to use this flag during the initial runs because it will be very slow and wasteful as it will re-read every block of every file.