macostimemachine

Time Machine API / Command-line scripts?


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!


Solution

  • 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.