rsync remote command not found

rsync's rather fabulous retro logo

Since moving back from Github Pages, I’ve been deploying Jekyll sites with rsync. It’s fast; doesn’t transfer unchanged assets; the usual qualities we’ve all come to expect from this excellent tool. I’m serious; from my hourly backups to site deployments and everything in between, I couldn’t imagine my life without it.

But I digress. Here’s my rsync deployment command for Jekyll, sent from my site’s Rakefile:

rsync -e 'ssh -i [private key]' --checksum --compress 
--delete --itemize-changes --recursive _site/

This hasn’t been a problem with my primary web host, but it generated the following error when attempting to push a Jekyll tree to our VPS:

bash: rsync: command not found
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: remote command not found (code 127) at io.c(605) [sender=3.0.9]
rake aborted!
Command failed with status (127)

I believe the word “derp” would adequately describe the issue. CentOS (and NetBSD) don’t ship with rsync by default. Installing it did the trick.

I’ve since read this doesn’t solve the problem for some people. According to Siddesh BG, the solution is to provide an absolute path to rsync on the destination host:

rsync [..] --rsync-path=/usr/local/bin/rsync [..]

Now if only I could use rsync to transfer a cake from the pastry shop down the road to my table now.