Diggin' Disk Images
by Jason Deraleau
Recently, I became frustrated with the selection of backup tools available for the Mac. At the time, I wanted to use a tape drive to backup user data. I had an Exabyte VXA-1 kicking around the office. I'm not sure if the drive itself was broken or if Retrospect's Mac OS X drivers for the tape drive were defective. Either way, I couldn't get it to work. Shamefully, I admit that implementing a good backup scheme went on the backburner for a few months. Then, I thought of a way to use disk images to make incremental backups.
At the time, I was using Mike Bombich's Carbon Copy Cloner to make a daily clone of the server's drive to a portable FireWire hard disk. This worked quite well, but I only had one FireWire drive to use. So, while I could get a daily backup, I couldn't get it off site in case of a disaster. Being that I'd recently started re-reading Unix Power Tools, I was in a scripting mood and decided to use the
find command and
hdiutil to roll my own backup system.
The basic idea is that I call my
bash script each night (easily accomplished with
cron). When the script starts up, it calls
find to search through a couple of folders for any files that have had their ctime or atime modified within the past day. Files meeting those criteria are copied to a staging location in
Once all of the files are collected, I use
hdiutil to create a read-only disk image of the staging folder. That disk image is then moved to a
Backups folder in
/Library. The next morning, I use Disk Utility to burn the latest disk image. Once a month, I burn a complete backup of the data folders using .Mac Backup (because it's convenient. You could easily use the Finder if you so desired). I throw the DVDs in a binder and bring them home. Then, I bring each day's disk image home and add it to the binder. Rinse, repeat.
One nice little bonus is that I have about a month's worth of disk images in
/Library/Backups to work with. So when one of my users accidentally deletes last week's TPS report, I can easily open up the past Friday's disk image in the Finder and drag the file back into place. Quite convenient and saves me a trip home to bring in that day's CD. If you'd like to see my handy work, you can find the script here.
What kind of tricks are you doing with disk images? Have a piece of Mac backup software you prefer?
Ouch! Don't ever miss a day!
It's all god fun and games until someone loses an eye.
RE: Ouch! Don't ever miss a day!
Well, the script is run automatically by
Why not use rsync? It will find out for you what you should back up (incremental backups). Point it to the directories you care about, then hit the "make it so" button.
Correct me if I'm wrong, but
you might like rdiff-backup
I am using rdiff-backup to do incremental backups, and it is wonderfully easy to use. I highly recommend it. I'm using the latest stable version, which ignores resource forks, but they're working on resource support for the next version.
TidBits has great Mac OS X Backup ebook
You might want to take a look at the ebook just published by the TidBits folks as part of their Take-Control series. This is a excellent overview of most of the available GUI backup solutions.
rsync or any other...
With all the options available, common backup programs are still designed for GENERAL users.
Sometimes it is not enough, for ex. I couldn't find one to meet my demands: I need to monitor several files, to back them up (particularly to make a copy with a name like: name_of_file_(yy/mm/dd/hh/mm/ss).ext) immediatly after any change, which is not periodic and can happen at any moment.
P.S. I do understand that such a task would take up quite of system resources.