I have two external harddrives that I use with Time Machine, alternating between them.

When I do a backup on one of them, unplug it and then plug in the other one, Time Machine will not use it automatically. I need to open the preferences, click "Select disk" and choose the drive from a menu. Then I unplug it, try to use the first one, same story.

How can I configure Time Machine to just use either of them as soon as they are attached?

link|improve this question

80% accept rate
feedback

1 Answer

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

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.