Saturday, January 12, 2013

rsync Mystery

rsync Mystery

After a long hiatus, I ventured onto my Synology NAS and discovered there were a few DSM updates pending.  The updates themselves add some pretty fantastic functionality, like Airplay support directly from the NAS and your own personal Cloud.  However, after the updates my automated rsync backup (Cygwin -> NAS) was failing with "rsync: command not found" indicating the rsync binary could not be found on the remote server.

Investigation

I could ssh to the NAS and execute "which rsync" to see that it was in "/usr/syno/bin/rsync" which was in my PATH variable.  However, when I ran "ssh root@foo 'which rsync'" I got nothing.  So I tried "ssh root@foo 'echo $PATH'" and I got a different path from when logged in directly!

Solution

To be honest I've no idea why the paths are different.  My guess is that the ~/.profile file is not being sourced during rsync connectivity.  Anyway, the easy-out was to create a symlink from somewhere on the standard path to the actual rsync binary: "ln -s /usr/syno/bin/rsync /opt/bin/rsync" and all worked well once more.

No comments:

Post a Comment