Upgrading rsync 2.6.9 on Mac OSX to a modern version

Unfortunately due to Apple not liking the GPL 3 license, many of the popular command line tools on OSX are now years out of date, and even broken in the case of certain uses of rsync. If rsync is a tool you use regularly then I definitely recommend upgrading it using the following steps.

First we get the source, the patches for OSX and expand everything to the same directory.

cd ~/Downloads
wget http://rsync.samba.org/ftp/rsync/rsync-3.1.0.tar.gz
tar -xzvf rsync-3.1.0.tar.gz
cd rsync-3.1.0
wget http://rsync.samba.org/ftp/rsync/rsync-patches-3.1.0.tar.gz
tar -xzvf rsync-patches-3.1.0.tar.gz

Apply the various patches.

patch -p1 <patches/fileflags.diff
patch -p1 <patches/crtimes.diff
patch -p1 <patches/hfs-compression.diff

Configure, make and install
./prepare-source
./configure
make
sudo make install

The last step is to update the path so that when you issue ‘rsync’ it uses the new version we just installed. Using your favourite editor, edit /private/etc/paths to make sure that /usr/local/bin is ahead of /usr/bin on the descending list of paths.

That’s it. Run rsync –version to make sure it worked.

Leave a Reply

Your email address will not be published. Required fields are marked *