In Ubuntu, I want to copy a big file from my hard drive to a removable drive by rsync
. For some other reason, the operation cannot complete in a single run. So I am trying to figure out how to use rsync
to resume copying the file from where it left off 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. Manually stopping rsync
early and checking the size of the received file also confirmed what I found.
But with --append
, rsync starts from what was left last time.
I am confused as I saw on the man page --partial
, --inplace
, and --append
seem to relate to resuming copying from what was left last time. Is someone able to explain the difference? Why don't --partial
or --inplace
work for resuming copying? Is it true that for resuming copying, rsync
has to work with the --append
option?
Also, if a partial file was left by mv
or cp
, not by rsync, will rsync --append
correctly resume copying the file?
--append
makesrsync
believe that, if two corresponding files have different length, then the shorter one is identical to the initial part of the longer one. So, yes, if you start copying a large file withcp
and interrupt the copy process, thenrsync --append
will copy only the remaining part of the file. (Note: ifcp
is interrupted by a system crash, there is a small chance that the file contents and metadata are not in sync, i.e., the file is corrupted. In this case, runningrsync
once more without--append
should fix the problem.) – Riccardo Murri Sep 26 '10 at 20:05--partial
without--append
. – Chris Davies Apr 17 '16 at 07:55--append
and--append-verify
have a dangerous failure case: when the receiver's file is the same size or larger but has different data. I suggest a solution based around--no-whole-file
instead. – Tom Hale Oct 06 '19 at 10:27