2

I'm try to transfer a large (1GB+) file from one machine to another, but I have to tunnel through a gateway in between. I'm able to transfer small files just fine. However, with the big file, the transfer stalls mid-way through.

After reading a blog post on the stalling scp transfers, I tried using -l 8192 and even tried lowering it to -l 2000, but that just seemed to make it stall sooner:

scp -l 2000 -v -P 2222 username@localhost:/path/to/file.gz .

From the verbose output (-v) of the scp command, it look like the -l isn't getting passed on…

debug1: Sending command: scp -v -f -- /path/to/file.gz

Any other ideas?

Matt V.
  • 837
  • 1
  • 9
  • 12

3 Answers3

3

An ugly work around would be to use rsync instead of scp. The rsync program can reliably resume interrupted transfers. If it hangs, just break out with CTRL-C and repeat the command.

David Schwartz
  • 31,449
  • 2
  • 55
  • 84
2

I think you should use rsync in a screen session. An interrupt can be re-run with --ignore-existing option.

quanta
  • 51,413
  • 19
  • 159
  • 217
1

I don't think rsync is an ugly work around. Be sure to use the -c flag rsync, that way it can pick up where it left off if the connection gets interupted, also include the --verbose to see more info during the transfer.

Michael
  • 801
  • 1
  • 7
  • 15