Reliable file transfer over slow or flaky network link
Solution 1:
You can use rsync to copy your file from one computer to the other. rsync can use ssh as its underlying transport. Combine rsync --partial
with a script such as this one to try again in case of network failure, and you should be able to move your files even in the face of network errors.
Another way to do it would be to mount the remote filesystem on your local computer with sshfs -o reconnect
, and then just cp the file(s). sshfs/Linux will take care of the rest. Based on some testing I did today, this seems to be much slower than rsync.
Finally, you can set up a VPN between the two machines. This involves the most work, and either of the above solutions are much easier, but it would solve the problem of a flaky network connection. And as some people have noted, this can also be flaky. It can work if the VPN is very aggressive about reestablishing connections, as OpenVPN is, but the above solutions are much better.