Skip to content

Running on OSX

François edited this page Jun 4, 2015 · 3 revisions

OSX' primary file system is called HFS+. This filesystem has a bunch of specificities that a vanilla rsync doesn't support (yet ?). If you use HFS+, and if you want a real-full-backup, you should read the following instructions.

Re-compiling rsync with support for HFS+

Install developer tools

This first step may take quite a long time. To compile our HFS+-friendly-version of rsync, we will need some tools. The easiest way to get those tools is certainly to install XCode (from the Mac App Store) and then install the Command Line Tools from the freshly installed XCode.app (in the Preferences, go to the Downloads tab and install Command Line Tools).

Once everything is installed properly, open the Terminal application.

Get the necessary files

Download rsync sources from the official repository by typing the following in Terminal :

cd ~/Desktop
curl -O http://rsync.samba.org/ftp/rsync/src/rsync-3.1.1.tar.gz
curl -O http://rsync.samba.org/ftp/rsync/src/rsync-patches-3.1.1.tar.gz

We then have to uncompress the downloaded files. Still in Terminal, type the following :

tar -xvzf rsync-3.1.1.tar.gz
tar -xvzf rsync-patches-3.1.1.tar.gz
rm rsync-3.1.1.tar.gz
rm rsync-patches-3.1.1.tar.gz
cd rsync-3.1.1

Apply the relevant patches :

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

Finally, compile :

./prepare-source
./configure
make
sudo make install

This will install our HFS+-friendly-version of rsync in /usr/local/bin/rsync. You can check that everything is OK by running the following (still in Terminal, of course) :

/usr/local/bin/rsync --version

You should get a result that looks like this (important part here being that file-flags is listed in Capabilities) :

$ /usr/local/bin/rsync --version
rsync  version 3.1.1  protocol version 30
Copyright (C) 1996-2014 by Andrew Tridgell, Wayne Davison, and others.
Web site: http://rsync.samba.org/
Capabilities:
    64-bit files, 64-bit inums, 64-bit timestamps, 64-bit long ints,
    socketpairs, hardlinks, symlinks, IPv6, batchfiles, inplace,
    append, ACLs, xattrs, iconv, symtimes, file-flags

rsync comes with ABSOLUTELY NO WARRANTY.  This is free software, and you
are welcome to redistribute it under certain conditions.  See the GNU
General Public Licence for details.

Once this is done, you are just a few minutes away from running your brand new backup tool !

Setting up the WABAC Machine for HFS+

Edit your configuration file

Open your configuration file with your favorite editor (you may need to be root to do so). You'll see a few preferences that you can edit to suit your needs. We are going to uncomment (remove the '#') a few lines, and specify a value for rsync_path.

First, find the line that starts with :

opts=(

This preference allows us to specify the options rsync will run with. For HFS+, we need a few more options.

A few lines after, you will see that some lines are commented (the line starts with a '#'). Uncomment them so that they look like this :

# Those are specific to HFS+ (OS X)
# You'll certainly need to compile rsync with a few patches to get them working.
# See https://github.com/Frzk/WABACMachine/wiki/Running-on-OSX
    --crtimes                   # Preserves create times
    --fileflags                 # Preserves file-flags (chflags)
    --force-change              # Affects user-/system-immutable files/dirs
    --hfs-compression           # Preserves  HFS compression if supported
    --protect-decmpfs           # Preserves HFS compression as xattrs
)

Now find the line (should be the last one) that starts with :

rsync_path=

And edit it with the path to your new rsync :

rsync_path=/usr/local/bin/rsync

Save and close your config file. You are ready to start the WABAC Machine for the very first time !