I use scp shell command to copy huge folder of files.
But at some point of time I had to kill the running command (by Ctrl+C or kill).
To my understanding scp copied files sequentially, so there should be only one partially copied file.
How can same scp command be resumed to not overwrite successfully copied files and to properly handle partially copied files?
P.S. I know I can do this kind of stuff in rsync, but scp is faster for me for some reason and I use it instead.
You should use rsync
over ssh
rsync -P -e ssh remoteuser@remotehost:/remote/path /local/path
The key option is -P
, which is the same as --partial --progress
By default, rsync will delete any partially transferred file if the transfer is interrupted. In some circumstances it is more desirable to keep partially transferred files. Using the --partial option tells rsync to keep the partial file which should make a subsequent transfer of the rest of the file much faster.
Other options, such -a
(for archive mode), and -z
(to enable compression) can also be used.
The manual: https://download.samba.org/pub/rsync/rsync.html