Linux – How to backup a couple of macs to a Linux sever

backupincremental-backuplinuxmactime-machine

I currently use rsync with –link-dest to get an incremental Time Machine-ish backup of few sources with a variety of operating systems to a single Linux box. I swap out the backup drive to an external site every so often. One of these sources is a mac and while rsyncing from the Linux box to the mac appears to work, it believe it isn't catching all the details of the HFS+ filesystem so I couldn't really do a full restore from an OS DVD if I need to. Also, it takes an awful long time to backup the mac compared to other sources with similar amounts of data and number of files. So, I thought I would use Time Machine for the macs and continue using rsync for the other sources. Is Time Machine the best way to do this? If so, what do I need to do on my Linux server to have it be a valid Time Machine target? If not, what do you suggest?

I know there are several (Time Machine to Linux) pages on the Net, but I thought ServerFault could use one.

Best Answer

Do it via a NAS share (samba or NFS).

I use Time Machine to back up to a ReadyNAS (which runs Linux under the hood). Here are my notes on how to do so.

Enable NAS backups:

 - defaults write com.apple.systempreferences TMShowUnsupportedNetworkVolumes 1

Find MAC address of the machine to be backed up:

 - ifconfig en0 | grep ether | sed s/://g | sed s/ether//

Command to create sparsebundle to copy over to NAS:

 - sudo hdiutil create -nospotlight -library SPUD -size 160g -fs "Case-sensitive Journaled HFS+" -type SPARSEBUNDLE -volname "hostname Backup" ./<hostname>_<macaddress>.sparsebundle

You need to insert your hostname and mac address to fit. This setup has been working with no major issues for quite a while now.

PS. You need to adjust the size of the volume. I have it set to 160GB as it's only backing up a Mac Mini.