In Ubuntu, I want to copy a big file from my harddrive to a removable drive by rsync. For some reason or other, the operation cannot complete in a single run. So I am trying to figure out how to use rsync to resume file copying from where it was left last time.
I have tried to use the option –partial or –inplace, but together with –progress, I found rsync with –partial or –inplace actually starts from the beginning instead of from what was left last time. Mannually early stopping rsync and checking the size of the received file also confirm what I found.
But with –append, rsync starts from what was left last time.
I am confused as I saw on the manpage –partial, –inplace or –append seem to relate to resuming copying from what was left last time. Can someone explain the difference? Why –partial or –inplace do not work for resuming a copy? Is it true that for resuming a copy, rsync has to work with option –append?
Also if a partial file was left by mv or cp not by rsync, will rsync –append correctly?
Thanks and regards!
Best Answer
Looking at some pages for rsync:
Sounds like if the file is very big, you would want to use
--partial --append
. (--append
implies--inplace
) If this big file changes, then drop the--append
and rsync will check the beginning of the file to ensure it too matches the source file.--inplace
to me sounds dangerous, except if you are rsyncing a big file, you don't want rsync to create a new temporary file of the beginning part, continue the transfer, then remove the old file to put the new file in place. The transfer would go faster if you could use the same file, not to mention the disk space needed for the transfer would be less.Also, I've found from a whole file transfer stand point a copy is faster than rsync. However, if I needed to update a file, I've had rsync sync the file faster than retransferring the whole file again. (like I said above) Rsync should be able to resume from a cp.
I hope this helps.