Backing Up with rsync, iCal, and Applescript

This morning marks the completion of the first full backup I’ve done in quite a while. But not the last. For the past 3 months, I’ve been working on an automated backup system – so I no longer need to wonder if things are backed up. They are. In at least two places.

A little background:

  • I only have Macs in my house. One of them…the Mini, acts as a server
  • I’ve got a StrongSpace account. Not that this makes much of a difference, any accessible volume could work the same (I’m intrigued how S3 might work into the mix as well).

The backup system is tiered;

  1. Every couple of days, the “client” Macs, the ones that get used everyday, backup to the Mini with
    rsync -aE --exclude='.*' /usr/bin/ssh /[path to source folder (see below)]/ [username]@[url of local server]:/[path to your backup directory]/

    I’ve got these all wrapped up in a single file, with a line for:

    ~/Library/Application Support

  2. Then, the Mini backs up the client folders to StrongSpace.
    rsync -rltvz --exclude='.*' /usr/bin/ssh /[path to client backup folder]/ [username]@[url of online server]:/[path to your online backup directory]/
  3. I’m using SSH Keys (the /usr/bin/ssh in the strings above) to automate the login (see MagpieBrain for instructions on setting this up).
  4. On all the machines, the file is wrapped in an Applescript
    do shell script "/Users/garrickvanburen/Documents/Projects/RSYNC/"
  5. The Applescript is called from an alarm in iCal, like this

What’s your backup strategy?

David Roessli takes a different approach.