Is there a way to continue broken scp (secure copy) command process in Linux?

Matko picture Matko · Dec 31, 2013 · Viewed 104.6k times · Source

I am copying 7.5 GB file to a remote server using scp command. At some point in time file transfer breaks and I have to start all over again.

Is the temporary amount of file being transferred completely lost ? Can I somehow restart the transfer from where it has stopped at previous attempt ? If not, is there some standard Unix command line file transfer command for doing that ?

Answer

Tom McClure picture Tom McClure · Dec 31, 2013

If you need to resume an scp transfer from local to remote, try with rsync:

rsync --partial --progress --rsh=ssh local_file user@host:remote_file

Short version, as pointed out by @aurelijus-rozenas:

rsync -P -e ssh local_file user@host:remote_file

In general the order of args for rsync is

rsync [options] SRC DEST