Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I've been trying to use rsync on OSX to Linux or Unix box over which I don't have much control. I've been doing something like this

rsync -avz -e ssh remoteuser@remotehost:/remote/dir /this/dir/ 

Error returned is:

bash: rsync: command not found rsync: connection unexpectedly closed (0 bytes received so far) [receiver] rsync error: remote command not found (code 127) at /SourceCache/rsync/rsync-37.3/rsync/io.c(452) [receiver=2.6.9]

However, after reading the docs I'm beginning to think that I would actually need to install an rsync daemon on the remote host.

  1. Must I install an rsync server on the remote host?
  2. Free alternatives -- GUI or non-GUI -- which do not require installing anything on the remote host?

Thanks!

share|improve this question
    
What are the exact problems are you having with your current command? –  fideli Feb 7 '10 at 14:11
    
@fideli, sorry, forgot about that. Editing question now –  Yar Feb 7 '10 at 14:16
    
Thanks for this question, but can you tag it rsync please? –  Andrew Grimm Oct 17 '10 at 3:54
    
@Andrew Grimm, thanks, retagged it. –  Yar Oct 17 '10 at 14:23
add comment

4 Answers

up vote 12 down vote accepted

You need an rsync command on the server, but you don't need to run a daemon.

Get an rsync binary that works on the server, put it somewhere in your home, and add this flag to your command line: --rsync-path=/home/user/path/to/rsync .

If you don't want to copy rsync to the servers, you can use scp, or sshfs.

sshfs user@host ~/sync/user-host
rsync -av ~/local-dir ~/sync/user-host/remote-dir

In that case rsync will run completely locally, but the changes will be propagated to the server.

share|improve this answer
    
I like that solution a lot, particularly because the server is a cheap hosting plan on GoDaddy and I doubt I'll be able to run rsync on the server. +1 for now! –  Yar Feb 7 '10 at 15:11
    
What's the easiest route to go for install of sshfs on OSX? MacFuse or is there something easier? –  Yar Feb 7 '10 at 15:24
    
MacFuse + (MacFusion or sshfs-static-leopard), I think (I'm not an OSX user) –  Tobu Feb 7 '10 at 15:37
    
Yes MacFuse does it. Just that the download page for the sshfs binary gives you the binary with a .gz extension. So you have to rename it instead of gunzip'ing it. Annoying but okay now! Thanks –  Yar Feb 7 '10 at 16:32
add comment

You need to have rsync on the remote host -- not necessarily an rsync server (which, I believe, won't handle the ssl connection anyway), but rsync on the local box needs to talk to an rsync on the remote box. You're using ssh to link the two.

Assuming rsync does exist on the remote box, it is not in the default search path for your ssh logged in shell. Depending on your preferences and permissions on the remote box, you can try

  • using the --rsync-path= option
  • changing the default PATH for your remote ssh shell
  • adding an alias for rsync in the remote ssh shell
  • changing the executed remote command to the absolute path to rsync

or something similar. If rsync as an executable (vice server) does not exist on the remote host, it would have to be added.

share|improve this answer
add comment

There is not much point using rsync without running an rsync daemon on the remote host, in spite of the creative sshfs solution proposed above. The whole idea of efficiency in rsync is to have the two instances compare their local copies of the dataset by calcuating checksums locally, comparing them over the network, and only transmitting the actual data for those parts of those files which actually differ.

If you use sshfs or any network mount, it's only hiding the fact that it has to copy the entire dataset across the network from the remote host in order to calculate the checksums locally, and then transmit the differences on top of that. It would be quicker and cheaper to delete everything locally and 'scp -r' the lot.

share|improve this answer
1  
Not exactly, because rsync checks whether files are modified by size and timestamp, and that's still a lot more efficient than scp'ing all files. But indeed, the rsync incremental update mechanism within files doesn't make sense over sshfs. –  eldering Jul 14 '11 at 12:52
add comment

Try SCP. As you've already got ssh access you don't need to install anything else on the remote host :)

To copy files from the remote host to the localhost use :

# scp -R remoteuser@remotehost:/remote/dir /this/dir/ 

Or copy files from the localhost to the remote host with :

# scp -R /this/dir remoteuser@remotehost:/remote/dir 
share|improve this answer
    
Thanks Lee, SCP is great but it doesn't do "sync" right? –  Yar Feb 7 '10 at 15:07
1  
it must be a small "r": scp -r –  0x4a6f4672 Jan 23 '13 at 10:43
add comment

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.