10.6: Time Machine using multiple backup disks

May 20, '10 08:30:00AM

Contributed by: Anonymous

Snow Leopard only hint In Snow Leopard it's rather easy to have multiple Time Machine backups with different settings. You can simply write a script to change the preference files for the two (or more) different drives.

Up until now, my Time Machine has always been backing up on different drives without even turning it off or on again to let it accept the new preferences.

You can let your script run automatically with Do Something When, or some other third party location managers, or even as a repeating alarm in iCal, so you'll never have to worry about Time Machine again. Or you can simply run it manually of course.

This script can be used as a template. The following list of variables is used, and you will substitute the names you actually use for your disks and filenames:

This hint describes creation of the disk specific preference files.

property pth : "Macintosh HD:Library:Preferences:"
property d1name : "Full Time Machine"
property d1 : "com.apple.TimeMachine Full.plist"
property d2name : "Tiny Time Machine"
property d2 : "com.apple.TimeMachine Tiny.plist"
property active : "com.apple.TimeMachine.plist"

do shell script "defaults write com.apple.TimeMachine AutoBackup -bool false"

if (list disks) contains d1name then
  tell application "Finder" to if exists (pth & d1) then
    set name of file (pth & active) to d2
    set name of file (pth & d1) to active
  end if
else if (list disks) contains d2name then
  tell application "Finder" to if exists (pth & d2) then
    set name of file (pth & active) to d1
    set name of file (pth & d2) to active
  end if
end if

do shell script "defaults write com.apple.TimeMachine AutoBackup -bool true"


[crarko adds: I haven't tested this one, but did fill in my variables and compile the script. There's a previous hint that discussed doing this manually.]

Comments (15)


Mac OS X Hints
http://hints.macworld.com/article.php?story=2010051917410348