I'd like to use tar cf - | ssh user@hostname tar xf - to copy a very large set of files. The only problem is that it will be over a very flakey VPN link.

Is it possible to somehow set up a resumable transfer like this? I would use rsync, but I'm not sure how to do it because the way the SSH keys are organized means the copy destination must initiate the command.

  • Rsync certainly should work, I wouldn't spend any time on trying on tar, and strongly suggest that you should be spending your time on making rsync work for you. – Zoredache Sep 7 '12 at 17:07

You can still use rsync from the "destination".

Here is the command to run on the destination server.

rsync -avz <username>@source.com:/path/to/backup /local/path/to/copy/backup/to

Replace the and of the source server where you want to copy data off of.

You do not need rsync "server" running on the remote host. This happens transparently to the end user as long as your ssh to the source server works.

Just run the command as-is and rsync will work over ssh from destination copying data from source.

|improve this answer|||||
  • Mustn't an rsync server be running on source.com in this situation though... I don't get to install stuff or run services on source.com as it is a client's server. – sirlark Sep 7 '12 at 17:25
  • When using SSH as a transport, you don't need a running rsync server. You simply need the rsync to be installed. Rsync over ssh will temporarily start rsync as a daemon on the remote side over the SSH pipe. – Zoredache Sep 7 '12 at 17:27
  • Fantastic, rsync is at least installed :) – sirlark Sep 7 '12 at 17:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.