To continue a stalled SCP file transfer is easy using rsync. The rsync command will allow you to continue a partial file transfer using SSH to encrypt the transfer. Many times when doing a large file transfer with SCP you run the risk of the connection to the server dropping during the transfer or of the transfer becoming stalled. Regardless of either one you can continue things with rsync as shown below.
The below command should be run from the server that the file is being transferred too.
- rsync --partial --progress --rsh=ssh user@server.example.com:/path/to/file/remote-file-name local-file-name
Make sure rsync is installed on both servers. If rsync is not installed it can be installed via yum by using the below syntax.
- yum install rsync
If your connection drops again or continues to drop you can run the rsync command in the background using “&” or you can continue to run the same command and it will continue where it left off transferring the file over an encrypted connection.