Back Up Your Mac on a Network Drive

Macs are kind enough to ship with built-in backup software.  How considerate, right?  Well, not really; it's just another excuse for Steve Jobs to dig his claws into your wallet.  See, the fancy Time Machine software only works if you buy another Apple product to go along with it.  But what if, like me, you've got a Windows or Linux-based media PC?  Can't you use that as a network drive?  Of course you can.  Here's how.

What Didn't Work

Turns out I'm not the first person to try this.  Someone wrote a wonderful set of instructions on how to "trick" the Apple software into using a network drive hosted by Windows or Linux.  It's pretty simple and easy to follow.  But it didn't work for me; something about permissions.  (For the Propeller Heads: Yes, I tried changing the owner, the group, and setting permissions to 777.  No luck.)

There are other instructions that suggest you emulate Apple's network drive protocol, but you have to compile it from source.  No thanks.

What Worked

For years, I've been using this wonderful program on Linux.  It's called Unison.  It's fast, it's flexible, it's powerful, it's easy to use, and it's super secure (even over a wireless network).  And guess what--now it's available for Mac too.

"Thanks Jordan, but no one other than you has a Linux file server at home.  This won't help me if I run Windows."  Ah yes but it will - the software is now available for Windows too!  (That's the beauty of open source.)  The trick is you have to have it running on both ends.

That being said, I'll admit it was tricky to get it working for Yelena, because Apple handles files in a way that's fundamentally different from Linux.  Part of the solution was to use a newer version, 2.23.  It isn't yet available for my version of Linux, but there's a nice guy out there who created a repository I can use: https://launchpad.net/~abelcheung

For me, this still wasn't quite enough; it was still throwing me a lot of errors.  So I created a pretty fancy custom profile for Unison.  I bet you'd like to see it.

# Unison preferences file
root = /Users/isweetie
root = ssh://user@xxxxxx//backup

# I do it this way so I can pick which folders to sync.  I might want to add music and photos later.
path = Documents

perms = 0
#rsrc = false
times = true
fastcheck = false
owner = false
group = false

# These are weird files that get created by Mac OS and don't need to be synced.
ignore = Name .DS_Store
ignore = Name *.tmp
ignore = Name *._*

# I'm ignoring the Microsoft directories because they've got odd file flags and permissions, and ultimately this isn't user data; it's application data.  Doesn't need to be synced.
ignore = Path Documents/Microsoft*

If you really want to understand what goes into a Unison profile, you should check out the Unison user manual.

Conclusion

This may seem overly complicated, but honestly it was easier than getting Time Machine to work.  Now Yelena has a sync utility that is fast, reliable, and easy to use.  It's a program I feel comfortable with, and I highly recommend it as the best sync utility for the Mac.

J<