Back Up Your Mac to Multiple Disks with Time Machine

Since the release of Time Machine, backing your Mac up has never been easier. If you want to back up different sets of files to more than one drive, though, this script will help you do so.

Time Machine, in typical Apple fashion, will seamlessly back up your data with little effort on your part. However, when it comes to doing something a little more advanced, Time Machine isn’t quite wired to do so. It can back up to multiple disks, for instance, but you’d have to change the preferences every time, which can be a pain. Thus, if you want to, say, back up your whole disk to one drive and only one subset of files onto other drive, you’ll need to automate it yourself.

To start, open up Time Machine and configure it to back up to your first drive with your desired preferences. After it goes through the first backup, head into /Library/Preferences and rename the file to (or whatever other name you want to call it instead of ‘Disk1’). Go back into Time Machine, plug in your second drive, set the preferences for it, and let it back up too. If you go back to /Library/Preferences, the will have reappeared, and you can rename it to

Next, open up Applescript Editor and paste this template into the box:

property pth : “Macintosh HD:Library:Preferences:”
property d1name : “Backup Disk 1”
property d1 : “”
property d2name : “Backup Disk 2”
property d2 : “”
property active : “”
do shell script “defaults write AutoBackup -bool false”
if (list disks) contains d1name then
tell application “Finder” to if exists (pth & d1) then
set name of file (pth & active) to d2
set name of file (pth & d1) to active
end if
else if (list disks) contains d2name then
tell application “Finder” to if exists (pth & d2) then
set name of file (pth & active) to d1
set name of file (pth & d2) to active
end if
end if
do shell script “defaults write AutoBackup -bool true”

Time Machine can still only back up to one disk at a time, so the best way to do it is plug in the disk you want to back up and run the script. It will then automatically back up to that disk for as long as it’s plugged in. When you want to back up your second disk, just eject the first one, plug in the second one, and run the script again. Time Machine will then back up to the second disk with those preferences until you disconnect it. It’s not as perfect as being able to back up to both without fiddling with them, but it’s still a heck of a lot easier than manually moving preference files around yourself (or resetting the preferences every time you want to back up a new disk).