(Not a Mac user, so cannot validate the answer.)
The article Automatically switching between different Time Machine disks describes an approach that could help solve this problem :
With some googling I found out, that the destination disk was written
in the /Library/Preferences/com.apple.TimeMachine BackupAlias
property and could be read with
defaults read /Library/Preferences/com.apple.TimeMachine BackupAlias
This gives you a rather long string starting with something like
<00000000 014e0002 .... That's what you need for later. And for both
disks.
Next I wrote two little shell scripts, looking like this:
#!/bin/bash
defaults write /Library/Preferences/com.apple.TimeMachine BackupAlias '<00000000 014e0002 ....>'
and started them, when needed. No more half a dozen mouse-clicks and
typing in that password every time, just calling that script was
enough, but still not perfect. Jiayong Ou to the rescue, which
made me aware of the context-and-location-aware and free application
MarcoPolo. A little bit of configuring and I have now a fully
automated backup solution at home and at the office. I additionally
added the line
/System/Library/CoreServices/backupd.bundle/Contents/Resources/backupd-helper -auto &
to my script and a delay of 30 seconds in MarcoPolo, so that my backup
started immediately when I'm online again and after the disk
preference actually switched. Doesn't work always, since it's aborting
a maybe running old backup, but seems not to do harm either.