1

I am trying to rsync between a Linux box and a MacOS box.

The MacOS (yosemite) seems to come with an old version of rsync so I've updated that using homebrew. OK, I seem to have perfectly matching versions:

wim@wim-imac:~$ rsync --version | head -n 1
rsync  version 3.1.1  protocol version 31
wim@wim-imac:~$ ssh wim@wim-dell
wim@wim-dell:~$ rsync --version | head -n 1
rsync  version 3.1.1  protocol version 31

If it's "pulling" from the MacOS box (i.e. the destination is local and the source is remote) it works:

wim@wim-imac:~$ rsync -nvvvv wim@wim-dell:/media/wim/wim_2tb/guitar /Volumes/wim2TB/guitar | grep Protocol
(Server) Protocol versions: remote=31, negotiated=31
(Client) Protocol versions: remote=31, negotiated=31

But if it's pushing from the source box (linux) to the mac, now there's a little problem - there's a protocol mismatch.

wim@wim-imac:~$ ssh wim@wim-dell
wim@wim-dell:~$ rsync -nvvvv /media/wim/wim_2tb/guitar wim@wim-imac:/Volumes/wim2TB/guitar | grep Protocol
(Server) Protocol versions: remote=31, negotiated=29
(Client) Protocol versions: remote=29, negotiated=29

So the symptom of this is since we've negotiates the lowest common denominator protocol 29, I don't get support for --iconv and any filenames with funny characters get screwed up.

wim@desk35:~$ rsync -nv --iconv=UTF-8,UTF8-MAC /media/wim/wim_2tb/guitar wim@wim-imac:/Volumes/wim2TB/guitar
rsync: on remote machine: --iconv=UTF8-MAC: unknown option
rsync error: syntax or usage error (code 1) at /SourceCache/rsync/rsync-45/rsync/main.c(1333) [server=2.6.9]
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: error in rsync protocol data stream (code 12) at io.c(226) [sender=3.1.1]

I looked for any kind of rsyncd to kick that might be running on the Mac using ps aux, ps -ef, but I couldn't find it.

Why does the mac machine select the old protocol version when contacted from remote, and how can I make it use the newer version of rsync that I've installed?

1

I'm guessing that the homebrewed version of rsync is in /usr/local/bin instead of /usr/bin (which is as it should be), but when rsyncing from your linux box it's executing /usr/bin/rsync as the remote agent. If that's the problem, you should be able to fix it by adding --rsync-path=/usr/local/bin/rsync (or whatever the actual path is on the OS X side).

Note: please don't replace the Apple-supplied version of rsync in the /usr/bin directory -- that way lies madness.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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