TimeMachine backs up to multiple disks
If anyone else out there is trying to figure out how to back up their mac laptop using time machine with more than one disk (say, one at work and one at home), I've worked it out. Here's how you do it:
First, download the Do Something When application, from
http://www.azarhi.com/Projects/DSW/
this installs a preference pane within which you can define actions to be taken when a particular disk mounts, for example open an application. Mine has two actions defined--one for when the disk at home mounts, one for when the disk at work mounts. Both actions run the same application (TM.app) after a two-second delay (just in case).
TM.app is just an applescript I wrote (modified from something I found that didn't work), that is packaged as an application. Here's the script:
------
property pth : "Macintosh HD:Library

references:"
property pth1 : "Macintosh HD:Library

references:TM:"
property pth2 : "Macintosh HD:Library

references:TM-Home:"
property d1name : "TM"
property d2name : "TM-Home"
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 (pth1 & active) then
duplicate file (pth1 & active) to folder pth with replacing
end if
else if (list disks) contains d2name then
tell application "Finder" to if exists (pth2 & active) then
duplicate file (pth2 & active) to folder pth with replacing
end if
end if
do shell script "defaults write com.apple.TimeMachine AutoBackup -bool true"
-----
What the script does is to turn off TimeMachine, then copy a preferences file from a subdirectory of Preferences into the main directory, depending on which disk is mounted, and then it turns TimeMachine back on. To create these preferences files, you have to go into Time Machine prefs and (mount and) choose the disk and run TimeMachine once, then copy the resulting com.apple.TimeMachine.plist into the appropriate subdirectory, and repeat the process for the other disk. Once that's done, though, it runs without intervention. If you turn the laptop on and no external disk is mounted, nothing happens.
On my machine, the preferences files and the TM.app are all owned by root: TimeMachine will reset ownership of its preferences to root every time it's run, so I think at least TM.app needs to have root ownership, otherwise the copying of other files over the default preferences file won't be permitted.
By the way, along the route to this solution I discovered something many no doubt already know--that the root user is disabled by default in Snow Leopard, and you have to turn it on in order to be able to chown various things to root:
http://snowleopardtips.net/tips/enable-root-account-in-snow-leopard.html
and then turn it off again, of course....