If you do a lot of downloading via scp and occasionally find yourself restarting a download that failed due to a closed connection, here's an alias that can help. Add the following to your user's ~/.profile file to create a "resumable scp downloading command:

alias scpresume="rsync --partial --progress --rsh=ssh"

This command uses rsync, and sets options for resumable transfers (--partial), displaying a progress bar (--progress), and insures that the transfer will be made using secure shell (-rsh=ssh). To use the command, open a new shell after saving your modified .profile file, and then type scpresume in place of scp in your normal transfer command.

[robg adds: I added detail to the original hint submission, so I apologize if I got some of the details on the rsync options incorrect.]

Hint Options

Click here to return to the 'Use an alias to ease resumable scp transfers' hint

The following comments are owned by whoever posted them. This site is not responsible for what they say.

this does the same but increases with speed
Authored by: ehunt123 on Jul 14, '08 09:21:53AM

I picked this shell script up years ago that performs an identical function but uses blocks to help with speed. I've never had an issue with the scpresume (I keep it aliased in my 30k .bash_profile), but did have a few issues when transfering very large files (>100MB) over slower links (something not inside your own network). Header is retained with the original author.