Is it possible to run cp
again after it was aborted and make it start where it ended last time (not overwrite data that's already copied, only copy what's still left)?
Is it possible to run cp
again after it was aborted and make it start where it ended last time (not overwrite data that's already copied, only copy what's still left)?
It's cases like this that have taught me to use
rsync
from the start. However in your case, you can use rsync now. It will only copy new data across, including ifcp
stopped half way through a big file.You can use it just like cp, like this:
In case the aborted
cp
was a recursive copy, you might want to resume with rsync including the option--recursive
.Example
Aborted copy command:
Let us assume that
destination-directory
already existed, so that this copy command created a directory namedsource-directory
withindestination-directory
. This can be resumed via:Note that trailing slashes have a precise meaning in rsync path options.
In this case, the copy command could have gotten the argument
source-directory
orsource-directory/
, it does not make a difference. In the rsync command, however, it must besource-directory
without trailing slash.Use the -u switch, and see the cp man page.
rsync is a great tool also: man page at -> http://www.manpagez.com/man/1/rsync/