rsync server on mac os x

For development purposes, I’d like to run a rsync server on a Mac.

People in forums recommend to avoid the default system rsync, which is accused of being buggy. Instead, they recommend RSyncX.

Unfortunately, I failed to get the tool. Its home page (temporary) disappeared. I’ve downloaded a .sit-distro from some other server. How can I unpack a .sit? No way except using StuffIt tools. To download the expander, I had to register. I even did it, but something went wrong and I didn’t get a download URL.

Finally, I decided to go with the system rsync. Maybe it’s not ideal, but it should be enough for development. The production server will work under Linux.

The rest is easy. Google search by “rsync.plist” immediately gives the desired page: “Launching rsync daemon via launchd on Mac OS X 10.4 Tiger” (I run 10.5, but it’s not importtant).

Additional steps:

1) Change ownership for the installed file:

$ sudo chown root:wheel /Library/LaunchDaemons/rsync.plist

2) It’s a good idea to create the file /etc/rsyncd.conf.

3) No need to reboot the machine to get the rsync daemon up and running. Enough to say:

$ sudo launchctl load -w /Library/LaunchDaemons/rsync.plist

Backup of rsync.plist:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
        <key>Disabled</key>
        <false/>
        <key>Label</key>

        <string>rsync</string>
        <key>Program</key>
        <string>/usr/bin/rsync</string>
        <key>ProgramArguments</key>

        <array>
                <string>/usr/bin/rsync</string>
                <string>--daemon</string>
        </array>
        <key>inetdCompatibility</key>

        <dict>
                <key>Wait</key>
                <false/>
        </dict>
                <key>Sockets</key>

                <dict>
                        <key>Listeners</key>
                        <dict>
                                <key>SockServiceName</key>
                                <string>rsync</string>

                                <key>SockType</key>
                                <string>stream</string>
                        </dict>
                </dict>
</dict>

</plist>

Useful config option

For my needs, it’s useful to add (per each module (?)) the following to rsyncd.conf:

exclude = .** **~

This disables transfer of files like “.svn“, “.filename.swp” (the first pattern) or “filename~” (the second pattern).

2 Responses to “rsync server on mac os x”

  1. Scott Heaberlin Says:

    Thanks for this. Most articles out there say to stay away from rsync on mac (for the reasons you mention) but like you said the “recommended” rsyncx seems to all but have disappeared.

  2. ofi Says:

    Thank you very much for this article which was exactly what I was searching for.
    I once tried RsyncX (on Panther I guess) and didn’t like it, because the GUI was kind of “notchy” and did not show me what was going on in the background.
    Those reaching for perfectness might consider to compile a fresh 3.x version of rsync from the sources as recommended by http://www.bombich.com/mactips/rsync.html

Leave a Reply