Regular Backup solution for a MacBook Pro
About a year ago, I gave up my G5 tower and began using a MacBook Pro as my primary desktop computer. So far, it’s worked out fine. I have the desktop power I need at work complete with external keyboard, mouse, and Cinema Display and I have the mobility I need to work at home or on the road. The only problem is making sure that everything is backed up regularly so that if anything happens while the machine is “in the wild” I won’t have to worry about losing everything.
We have a Tivoli backup system at work, which works great for desktops since they can be left on at night to run schedule backups. Leaving the laptop at work overnight kinda defeats the purpose of “mobile” computing, so I came up with this method to give me a little peace of mind. Note: When OSX Leopard hits, Time Machine may replace this method for me.
Update: As expected, Time Machine is WAAAY cool and has replaced my homegrown system. Still, this method works well if you don’t have Leopard yet, so I’ve left it up. Enjoy
Ingredients:
- External Firewire drive, at least as big as the internal drive on the Macbook Pro.
- Freeware utility, “Do Something When” (DSW) http://www.azarhi.com/Projects/DSW/
- Rsync and some scripting Glue
- Platypus for bundling up that cool script: http://www.sveinbjorn.org/platypus
-
Steps:
- Hookup and format External drive. Give it a simple volume name. Mine is “MaxtorBackup” Avoid spaces, it will make your life easier.
- Download and install DSW and Platypus. DSW installs as a preference pane.
- Open up the Terminal and create a folder for your scripts. I recommend something simple like “/Users/
/scripts” - In the scripts directory, create a shell script called “backup.sh” In it, place the following code:
if [ -e "/Volumes/MaxtorBackup" ]; then
rsync -aE ~/ /Volumes/MaxtorBackup/backup
osascript <tell application "System Events"
activate
set dd to display dialog ""Home" Folder nBacked up Successfully" buttons {"OK"} default button 1 giving up aft
er 30
set UserResponse to button returned of dd
end tell
EOFelse
osascript <tell application "System Events"
activate
set dd to display dialog "Please mount MaxtorBackup first!" buttons {"OK"} default button 1 with icon caution giv
ing up after 30
set UserResponse to button returned of dd
end tell
EOF
fi
- Use Platypus to wrap your script up in an apple Application Bundle. I'll leave that as an exercise for the reader (RTM).
- Create an action in DSW:
- Open up the preference pane and create a new rule that waits for MaxtorBackup to come online and runs your bundled script when it does. Make sure that "Automatically Start on Logon" is checked.-
That's pretty much it. Every time your backup device comes online, up pops your application and rsync syncs over anything that has changed since the last time. I've got mine set to sync only my home folder since everything else is more easily rebuilt from scratch (applications etc) You could just as easily modify the script to sync changes on your whole drive, but if you were doing that you might as well use Carbon Copy Cloner to create a clone of your drive periodically.
- In the scripts directory, create a shell script called “backup.sh” In it, place the following code: