If you tried to copy files via SSH you know that you can use scp
to do this. For example:
SCP#
scp you@1.2.3.4:/path/to/file.rar ./
# or to download folder
scp you@1.2.3.4:/path/to/folder ./
Most of the time, this solution works, but if you have an unstable connection, you have to start downloading files all over again. Even worse, if the file is large, it will take a long time to download.
I found another solution. Using a rsync
.
RSYNC#
Rsync can continue to download files in the event of connection problems.
rsync -r -P -e ssh you@1.2.3.4:/path-to/downloads/o .
Here are options from the example above:
-P
means--partial
--progress
which ensure that partially downloaded files remain on the disk. This means that if you have connection problems, you do not have to download the files again.-r
it is same as--recursive
and can be used when you downloading folders-e
specify the remote shell to use.