views:

356

answers:

3

Hello! I need the reference, if it exists, to Time Machine's API or simply some commands that can change the disk in use with Time Machine and back!

I'd like the script I'm going to write to do the following:

Change from disk A to disk B
Force Time Machine backup
Change from disk B back to disk A

Thank you!

+1  A: 

If AppleScript is fine with you have a look at this post with script. It should serve as a basis for your own.

extraneon
The solution doesn't appeal to me much, as I'm pretty sure it shouldn't be as complex as that just to swap a drive... I mean, right, it does work, and I could resort to that if I find absolutely nothing else...
MrZombie
Much of the complexity in that script is just checking whether the drive is available and doing the Growl notification. The actual logic to change drives isn’t too bad, and involves UI-scripting the Time Machine Preferences panel. While this is not an API, it is certainly the safe way to do it.
Nate
A: 

Apple time capsules include an 'archive' command that can back-up the time capsule disk to an external USB-attached disk.

Alex Brown
A: 

If I knew what to put there, it seems the file to edit is /Library/Preferences/com.apple.TimeMachine.plist.

You can achieve the correct configuration using "defaults write" to overwrite the relevant settings, although it seems like you have to modify the BackupAlias, which seems to be a hexdump of something I couldn't quite decipher. It does contain the path to my TimeMachine disk, though.

The sanest solution would be to copy the original settings, and then swap files whenever needed.

MrZombie
This worked, but I found a third-party solution to be superior to Time Machine for the purpose of the problem.
MrZombie