Building a FreeBSD backup server

In order to backup my Linux and Mac OS X boxes I set up a FreeBSD server running Netatalk and rsync as daemon. Netatalk plays nicely with Time Machine on the Macs, while rsyncd handles all files sent from my Linux box. This is a home setup, so I want things to be easy and didn't install BackupPC, Bacula, or such. And since my backup server runs inside a virtual machine, I chose good old UFS2 over ZFS after some testing. Interestingly, ZFS (gzip) compression saved more free space (overall ratio was about 1.6:1 of real data to compressed data) than deduplication (benefit was just 1.05:1).

That's all! Neither a fancy avahi nor netatalk configuration is needed. On your Mac open the Time Machine preferences, and click on Add or Remove Backup Disk. Under Available Disks you can select the volume exported by your backup server. If you do so, you will be asked for the tm user's password.
On my Linux box I use a simple shell script to backup my workstation:


rsync -avAHS --del --progress --exclude=/dev --exclude=/media --exclude=/mnt \
	--exclude=/proc --exclude=/run --exclude=/sys --exclude=/tmp \
	--exclude=/usr/portage --exclude=/var/lib/nfs/rpc_pipefs \
	--exclude=/var/tmp --exclude=/var/run \
	/ rsync://backup/linux/
While Time Machine creates historical backups, I created a simple cron job on the backup server to snapshot the rsync area:

today=`date +%a`
rm -f "/backup2/.snap/$today"
mksnap_ffs "/backup2/.snap/$today"