backups.

I confess, I'm somewhat obsessed with my backups.

Ever since I tried to reload my data back from CDs and discovered that over half of them had gone bad in the 5+ years since I'd been burning them, I've spent more time thinking about how to save those digital things that are really important to me.

The picture to the right is the drive configuration of Hithlum, my PowerBook G4. While I'll be talking in Mac-specific (and UNIX-general) terms, you can use this strategy with other systems, too. If you're an impatient sort, you can just skip right to the code and figure it out.

I have two types of backups: onsite and offsite. Onsite backups are cheaper, quicker to execute, and can be converted to offsite by mailing a hard drive to a friend. But they don't protect against things that destroy your house, they can be stolen, they take up physical space, etc.. Offsite backups cost more, are vulnerable to different sorts of attacks, but will preserve critical documents in case of catastrophe.

Onsite Hard Drives

My strategy is to treat my backups (snapshots of my current computer) differently from my archives (data that doesn't have to live on my computer anymore.) You can delete files from backup automatically; you never do so with your archives.

I have three drives mounted via Firewire: Backup, Archive, and Mirror. I use Firewire because there's a lot of data being thrown around, and even USB 2.0 is too slow. Also, it's daisy-chainable, which makes it easier to handle on the desk. Note: OS X has a surprise for you when you first create an external hard drive: a little checkbox labeled "Ignore privileges on this volume" in the Get Info screen. Make sure it's unchecked, or your permissions won't flow through your backups.

Right. Three external drives:

What I like about this system is that it's easy to start small and work your way up. Only have one drive? Implement a single backup and create a folder called Archive. Two drives? Backup/Archive and Mirror. Three splits it out further.

Best of all, as drive prices fall and data needs get bigger, you can take drives out of rotation, reuse the case with the new drive, and send the old drive off to friends or family for safekeeping.

Offsite Drives

Okay, so here's the real problem. All of the above is local storage -- storage that, even if you take the hardrives elsewhere, are generally limited to your local area. They can be destroyed by the same things that can destroy your computer (fire, flood, toddlers) and, because they're usually in the same location, you're only protecting yourself against disk failure, not disasters. That's where offsite storage comes in.

Remote network drives can be mounted just like normal drives, and the same rules apply. They are more expensive than local drives, and you will have to seriously consider your security in transporting and storing your data offsite -- but they will let your data survive in the worst-case scenarios.

Media files are a special case. Because pictures accumulate at an alarming rate, I recommend taking advantage of zooomr, flickr, or any of a number of media-sharing sites. Just make a habit of uploading your good files and having them reside on the internet. In the words of Linus Torvalds: "Only wimps use tape backup: _real_ men just upload their important stuff on ftp, and let the rest of the world mirror it."

Many places can allow passwordless SSH logins, which allow you to rsync data to a remote server without manually mounting a drive. This is the way to go if your CLI Ninja skils are good enough.

You'll have to decide how much you want to store offsite, and how much you want to leave local. I personally keep everything realy important in an encrypted .dmg file and replicate that up to the server every day, but you'll have to find the balance that works right for you.

Shell Scripts

A few examples for you:

So, there you have it. Go forth and back up.