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
An alternative to rsync:
Use sftp
with option -r
(recursively copy entire directories) and option -a
of sftp
‘s get
command “resume partial transfers of existing files.”
Prerequisite: Your sftp
implementation has already a get
with -a
option.
Example:
Copy directory /foo/bar
from remote server to your local current directory. Directory bar
will be created in your local current directory.
echo "get -a /foo/bar" | sftp -r user@remote_server