If your download got cut off using scp, stop and read this before using scp again!
Telecommuting has it's perks. But one of the downsides can be the network issues. Especially if you have to download large amounts of data often. Having been bit by the interrupted downloads one too many times I found the following solution here.
The problem is that scp doesn't support resume, however rsync does. So create the following alias and you should be good to go:
alias scpresume="rsync --partial --progress --rsh=ssh"
Perks include understanding the same user@host:path syntax as scp as well as being able to resume a broken scp download (Note: I'm not guaranteeing this, but after downloading 90% of 400MB I was able to pick up the rest using this).
It doesn't seem to work everytime, after downloading 60% of 180MB, I used
this command and had to restart the download at 0%. With another download
it worked, dunno why...
You are my hero. This works so much better than other solutions I tried,
for continuing the download on a 12 GB file.
Brilliant -- this just made downloading a 1.5 GB Oracle binary through a
flaky connection oh so much easier. You, sir, are a genius.
Hello,
To specify a port when using ssh you must add it to the ssh command.
ex: rsync --partial --progress --rsh="ssh -p 16703" user@host:path
If you want something more lightweight than rsync, you can use cURL with
resume (-C -) flag: curl -T filename -C - -u yourlogin
sftp://example.net/~/filename
Awesome. This is exactly what I needed. My ISP is being a bitch right now
and closing my ssh connection every 5 minutes or so.
Beautiful... you trick with rsync/scp made my day - I was just able to
resume 2-gigabytes scp transfer that got disconnected
Sometimes this will not always work. So try these rsync options plus a bit
a bash looping
rsync -P --partial-dir=.partial --exclude=.* SRC DEST;
sleep 10;
Thanks for the info.
Thanks for this post. I use --bwlimit=10 --rsh="ssh -p 443" options at work
to get something from home without eating all upload bandwidth. Somehow scp
also uses proxy settings from my browser.