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).

Categories: Mac

Updated: