How to resume scp file transfer

When I was uploading a large file from server A to server B, the server B’s disk space ended up, so scp broke transfer and printed an error message.

SCP sent more than 4GB data (90%), so I was looking for a solution on how to resume the previous file transfer. Unfortunately, scp can’t resume file transfer, but … rsync can! In rsync manual we find –partial options:

–partial
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.

Now we can write a command like this:

rsync --partial --progress -e 'ssh' file_to_upload my.server-b.com:path

You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>