Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I would like to set up a task to sync 2 remote servers' files.

Historically I performed the following:

  1. SSH to Destination
  2. SU to user which has public key on Source
  3. Rsync over SSH to pull files to Source

Now however, the Source server has moved to a VPN for which the Destination does not have access to, so there is no longer a direct 'line of sight', so I'm now resorting to the following method:

  1. Rsync from Source to Local
  2. Rsync from Local to Destination

This has the downside however that a number of different Local machines may be used for the file syncing task, and so the overhead of a new local copy being created, or even the need to store a local copy on local machines is not preferable.

Is there a Linux / OSX based command line tool which can perform the above without needing a local copy?

share|improve this question

2 Answers 2

up vote 1 down vote accepted

If none of the source and destination can connect to the other end, there is no other way to copy the files other than copying them to a local machine as described.

However, you can do the following if you have troubles copying large amount of data:

  1. Copy the files and folders using several rsync commands.
  2. When done copying one file/folder to the local machine, copy it immediately to the other remote machine and remove it.

This way you can reduce the HD capacity needed to store the files locally. Also, you can write these in a script and use sleep to give the local machine some time to settle before resuming. You can use SSH keys to automate this to avoid prompting for a password. Of course, this assumes you don't need the data ASAP to copied to the other end.

share|improve this answer

Not exactly a command line tool, but do you have the ability to set up NFS mounts? Mounting the source and the destination filesystems should get you what you need.

share|improve this answer
    
NFS would be faster, but if it's not available SSHFS will work pretty much anywhere SSH does. –  Kowh Feb 13 '12 at 1:28

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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