Make Mac Work:

Helping Manage The Macintosh Enterprise

CreativeTechs

Command Time Machine

With it’s spacey presentation and it’s promise of effortless data safety, Time Machine is the marquee feature of OS X Leopard, mentioned in every review as worth the price of the upgrade alone. While the ability to minimize data loss on any machine is fantastic, Time Machine presents some unique challenges for the people tasked with maintaining those machines. The minimal configuration options that make Time Machine so easy to use can also make it hard to control. Fortunately, there are more tools available than are exposed in the graphical interface.

Exclude Files From Time Machine Backup:

While the Time Machine pane in System Preferences has an intuitive interface for excluding paths from backup, doing so for multiple files and folders (or worse still, multiple machines) can be time-consuming. Instead, you can specify files to avoid through the command line, either locally or sent over Apple Remote Desktop. In this example, just replace PATH-ONE and PATH-TWO with as many absolute paths as you have directories or files to exempt.

sudo defaults write /Library/Preferences/com.apple.TimeMachine \
SkipPaths -array-add "PATH-ONE" "PATH-TWO"

Change Regular Time Machine Backup Intervals:

Another Time Machine annoyance is the mandatory hourly scheduling, forcing the machine into heavy disk access even when it’s being used for other read/write intensive operations (like video editing and playback). You can adjust the time between backups, however, in the Terminal or by changing the preferences file with Property List Editor (available in Apple’s free Developer Tools).

If you’re altering Time Machine’s schedule programmatically, type the following:

sudo defaults write /System/Library/LaunchDaemons/\
com.apple.backupd-auto StartInterval -int SECONDS

Replace SECONDS with your desired wait between backups, specified in seconds (that’s 3600 per hour). This has the unwanted side-effect of restricting read permissions on the file, so if you want to edit these preferences again or have them run properly, you’ll have to set it’s permissions back to their original configuration like so:

chmod 644 /System/Library/LaunchDaemons/\
com.apple.backupd-auto

Editing the file with Property List Editor lets you skip the second step entirely, but confines you to manually adjusting the settings on each individual machine. A preferable approach is to push the command out to all your Macs using tools like Apple Remote Desktop, JAMF Casper Suite, or LANrev.

Schedule Time Machine Backups:

If you’d like to run Time Machine only at times you’ve chosen, the command can be incorporated into a legacy crontab, by preparing a scheduled job through launchd, or even by embedding the instructions in an Applescript and choosing “Run Script” from the “Alarm” options in an iCal event. The line you need is:

/System/Library/CoreServices/backupd.bundle/Contents/Resources/\
backupd-helper &

Prevent Unwanted Time Machine Dialogs:

By default, if you haven’t yet set a Time Machine volume, you’ll get asked if each and every disk you attach is a suitable backup destination. If you’re utilizing a different backup scheme, these dialogs can become an annoyance quickly. To put a stop to the them, the command you’re looking for is:

defaults write com.apple.TimeMachine DoNotOfferNewDisksForBackup \
-bool YES

Protect Database Files From Time Machine:

Finally, even Apple acknowledges that Time Machine has issues backing up live databases. The cause (and it’s effects) are still unclear, but it doesn’t hurt to be careful with applications which run a database in the background when closed (such as Microsoft’s Entourage). The problem can be avoided by logging out before scheduled backups occur. The database will safely close, and Time Machine will run as expected.

Recommended Reading: While we were proud to have originally figured out this first Leopard tip on our own, the article was later updated to include Josh Wisenbaker’s clever tip to Stop Time Machine Nagging, via the equally clever AFP548.com.