Backing up with an rsync server

I’ve tried many solutions to do a daily sync backup of my MacBook Pro to my Terastation, but I was never really happy with any of them. Among the software I’ve tried were Chronosync (which is probably the best of the bunch), Synk Pro, and Deja Vu.

Samba on the Terastation can be painfully slow – it can take several hours to back up my home directory. I’ve hacked my Terastation to support SSH, NFS, and a few other features (information is available at NFS is a lot faster than Samba, but the version I have on the Terastation has lots of problems.

I found that by far the fastest way to back up is using an rsync server. It isn’t too difficult to set up an rsync server on a Terastation or another Mac.

1. Make sure /etc/services contains the following lines:

rsync           873/tcp                         # rsync
rsync           873/udp                         # rsync

2. Add the following line to /etc/inetd.conf, if it isn’t already present:

rsync   stream  tcp     nowait  root    /usr/bin/rsync  rsync --daemon

After you add that line, send a hangup signal to inetd (killall -HUP inetd).

3. Finally, you’ll need to create /etc/rsyncd.conf which should specify which directories should be available to rsync:

#you should probably use your own user & group IDs
uid = nobody
gid = nogroup
use chroot = yes
pid file = /etc/

#this is the name you will use in your rsync command
#this is the actual directory
  path = /mnt/array1/share
  read only = no

To use it, specify the destination as an rsync URL on your rsync command, for example:

rsync -avzC --delete --exclude="._*" Music Documents Sources Work Pictures rsync://tank.local/share/Backup/mike/

This will tell it to back up your Music, Documents, Sources, Work, and Pictures folders from your home directory to /mnt/array1/share/Backup/mike on the rsync server (using the full path specified in the rsyncd.conf file).

For convenience, you can create a shell script with any rsync backup commands and schedule it to run using cron. Cronnix is the easiest way to set up your backup cron job.

Leave a Reply