Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am quite confused as to why rsync requires --rsync-path flag even when remote rsync is in path.


$ rsync -avze 'ssh -p 22' --delete public/
bash: /usr/local/bin/rsync: No such file or directory
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: remote command not found (code 127) at io.c(601) [sender=3.0.7]

then I tried adding --rsync-path

$ rsync -avze 'ssh -p 22' --rsync-path=/usr/bin/rsync  --delete public/
sending incremental file list

So, the first rsync was not successful because it was searching for rsync in /usr/local/bin but as soon as I pass the obvious path for rsync using --rsync-path, then it works.

Why is this? (this command line is the one issued by rake deploy in octopress)

share|improve this question
Do you have any forced commands at the destination end? Anything in the .bashrc or .profile that might set a local environment variable? – SmallClanger Oct 17 '12 at 12:20
$ cat ~/.bashrc | grep PATH returns nothing. – Paulo Matos Oct 17 '12 at 13:52
If you just ssh in yourself and run which rsync what do you get? – SmallClanger Oct 17 '12 at 13:56
$ ssh which rsync returns /usr/bin/rsync – Paulo Matos Oct 17 '12 at 15:07
Weird. Clutching at straws, now: Is perhaps your local rsync aliased to rsync --rsync-path (or some other local wrapper)? – SmallClanger Oct 17 '12 at 16:18

Your Answer


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

Browse other questions tagged or ask your own question.