Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

10.6: Time Machine using multiple backup disks System 10.6
Snow Leopard only hint In Snow Leopard it's rather easy to have multiple Time Machine backups with different settings. You can simply write a script to change the preference files for the two (or more) different drives.

Up until now, my Time Machine has always been backing up on different drives without even turning it off or on again to let it accept the new preferences.

You can let your script run automatically with Do Something When, or some other third party location managers, or even as a repeating alarm in iCal, so you'll never have to worry about Time Machine again. Or you can simply run it manually of course.

This script can be used as a template. The following list of variables is used, and you will substitute the names you actually use for your disks and filenames:
  • property pth: Path to Preferences folder, change the Volume name if necessary.
  • property d1name: Name of the first backup disk.
  • property d1: Time Machine prefs named after first backup disk.
  • property d2name: Name of the second backup disk.
  • property d2: Time Machine prefs named after second backup disk.
  • property active: The current active Time Machine prefs file.
This hint describes creation of the disk specific preference files.

property pth : "Macintosh HD:Library:Preferences:"
property d1name : "Full Time Machine"
property d1 : "com.apple.TimeMachine Full.plist"
property d2name : "Tiny Time Machine"
property d2 : "com.apple.TimeMachine Tiny.plist"
property active : "com.apple.TimeMachine.plist"

do shell script "defaults write com.apple.TimeMachine 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 com.apple.TimeMachine AutoBackup -bool true"


[crarko adds: I haven't tested this one, but did fill in my variables and compile the script. There's a previous hint that discussed doing this manually.]
    •    
  • Currently 3.00 / 5
  You rated: 3 / 5 (21 votes cast)
 
[32,417 views]  

10.6: Time Machine using multiple backup disks | 15 comments | Create New Account
Click here to return to the '10.6: Time Machine using multiple backup disks ' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.6: Time Machine using multiple backup disks
Authored by: aubreyapple on May 20, '10 07:13:00PM

There is a hint of this on the other thread, but I did not realize how serious this is. There really is a danger in this swapping. Here is what I have actually observed:

1) Do a time machine backup to Time Machine drive 1 (TM1)
2) do a time machine backup to Time Machine drive 2 (TM2)
3) create a file, call it 'A'
4) Do a time machine backup to TM1.
5) Do a time machine backup to TM2.

I think you will find that A is not on the TM2 drive.

This is a serious defect in this plan. I just got done temporarily loosing some iPhoto pictures when I did a complete restore from a backup where the pictures should have been there. The backup was on May 18 (TM1) and the pictures were placed on the drive on May 14th. I finally found the pictures on my Time Machine backup of May 15th (on TM2) which was done using a similar technique of swapping Time Machine drives. Yes the pictures would still have been there on May 18th when the May 18th (TM1) backup was done.

So, what this means is that the TM1 and TM2 are not redundant backups. They may each be missing part of what you think you have backed up.




[ Reply to This | # ]
10.6: Time Machine using multiple backup disks
Authored by: saxphile on May 20, '10 08:45:30PM

I second this observation. I suspect that Mac OS X keeps track of files that were changed since the last TM backup (regardless of volume) and only updates those files. The fact that the first backup after you switch drive is as fast as a backup on the existing drive is somewhat indicative of this behavior. I stopped using multiple drives for TM long ago and switched to a TM+SuperDuper redundancy strategy. It takes a very long time to mirror a TM backup drive (even with Smart Update), but I only do it once every two weeks.



[ Reply to This | # ]
10.6: Time Machine using multiple backup disks
Authored by: palahala on May 21, '10 01:01:52PM
The fact that the first backup after you switch drive is as fast as a backup on the existing drive is somewhat indicative of this behavior.

That's totally not what I am observing, and not what I've been validating using tools like Time Machine Buddy and TimeTracker.

[ Reply to This | # ]

Using multiple backup disks for Time Machine is perfectly save
Authored by: palahala on May 20, '10 10:42:34PM

I think you will find that A is not on the TM2 drive.

No, that it's NOT true.

In the comments in the other thread you'll also find references to Ars Technica, which has has some nice technical insight about Time Machine and how it relies on fsevents. And you'll read that Time Machine stores the last known event ID on the backup itself, in an extended attribute com.apple.backupd.SnapshotVolumeLastFSEventID.

Hence, Time Machine knows exactly when the last backup for a certain backup disk was created. So: unless file A is deleted from the filesystem very soon, you'll find it on both backup disks.

In your case, something else must have gone wrong.

Edited on May 20, '10 10:47:06PM by palahala


[ Reply to This | # ]
Using multiple backup disks for Time Machine is perfectly save
Authored by: aubreyapple on May 21, '10 10:16:55AM

Oddly, since no one knows what that 'other thing' could be that went wrong, I suspect it goes wrong for lots of people so the caution still applies. IMHO.



[ Reply to This | # ]
Using multiple backup disks for Time Machine is perfectly save
Authored by: palahala on May 21, '10 12:57:56PM

Not too odd to me, as it's really just not how fsevents works, and there's no reason to suspect Apple would stop using fsevents to determine what needs to be written to the backup.

So, care to tell us why you needed a full restore a few days after the backups, for which you claim Yes the pictures would still have been there on May 18th when the May 18th (TM1) backup was done? Maybe this actually calls for a high priority bug report then!



[ Reply to This | # ]
Using multiple backup disks for Time Machine is perfectly save
Authored by: chucky23 on May 22, '10 07:42:01AM

Short version for folks arriving late to the conversation:

- palahala is correct.
- aubreyapple doesn't have the slightest clue what he's talking about.

Apple explicitly supports using multiple TM destinations. This hint is safe in that regard.



[ Reply to This | # ]
Using multiple backup disks for Time Machine is perfectly save
Authored by: aubreyapple on May 22, '10 07:51:50PM

Well, you are right. I cannot reproduce the problem... not to say it did not happen to me, it did.

I still recommend caution.

So, chucky23, can you point to where Apple explicitly supports multiple destinations?

Thanks.

Edited on May 22, '10 08:00:09PM by aubreyapple



[ Reply to This | # ]
Using multiple backup disks for Time Machine is perfectly save
Authored by: Tantali on Jun 09, '10 09:08:16AM

I've used this script for nearly half a year and haven't encountered any problems with it, except for an occasional reluctance to start backing up (which is immediately solved by manually telling it once to start a backup)

Edited on Jun 09, '10 09:15:48AM by Tantali



[ Reply to This | # ]
10.6: Time Machine using multiple backup disks
Authored by: Sesquipedalian on May 21, '10 07:23:10AM
Rather than manually entering the value for property pth, just use this:

property pth: (path to preferences folder from local domain) as text

Now there is no need to worry about the script breaking if you change the name of you hard drive, etc.

[ Reply to This | # ]

10.6: Time Machine using multiple backup disks
Authored by: Tantali on Jun 09, '10 09:14:50AM

Thx!
It was indeed a bit annoying to change the script when I renamed my drive.

If you have any other suggestions for my script, don't hold back.
It's a very simple script, but as I am completely new to this, I had to google A LOT.



[ Reply to This | # ]
10.6: Time Machine using multiple backup disks
Authored by: Totoleheros on May 22, '10 03:29:39PM

Would this trick with the following configuration:

I have an 1Go Airport at home (password protected) and an external HD at my office.

For the time being, I must change manually my TM control panel setting. I have tried this trick:

http://www.macosxhints.com/article.php?story=20080105135511764

but I was not able to write the missing applescript code to pass the password (I have no expertise in this field)...

Any clues?



[ Reply to This | # ]
10.6: Time Machine using multiple backup disks
Authored by: indros on May 24, '10 08:38:05AM

Is there an Applescript command to list network drives? I'm backing up to a local USB drive at home, but a network drive at work.



[ Reply to This | # ]
10.6: Time Machine using multiple backup disks
Authored by: jaydisc on Jul 06, '10 12:51:03AM
I wrote a shell script that rotates an unlimited amount of drives assuming they're named the same. I just use 'diskutil' to get the UUID and 'defaults' to update Time Machine's prefs:
#!/bin/sh
mountedDisk=`diskutil info "Backup HD" | awk '/UUID/ {print $3}'`;
if test $mountedDisk
    then
    echo "Mounted Disk UUID: $mountedDisk";
    configuredDisk=`defaults read /Library/Preferences/com.apple.TimeMachine DestinationVolumeUUID`;
    echo "Configured Disk UUID: $configuredDisk";
    if test $mountedDisk = $configuredDisk
        then
        echo "Configuration is correct."
    else
        echo "Configuration requires update. Updating..."
        defaults write /Library/Preferences/com.apple.TimeMachine DestinationVolumeUUID $mountedDisk
        echo "done."
    fi
else
    echo "No Backup HD found."
fi
I then set launchd to run it every time a volume mounts. More info, including how to encrypt the backup, can be found here

[ Reply to This | # ]
10.6: Time Machine using multiple backup disks
Authored by: TonkaTuff on Jan 25, '11 04:03:37PM

I am new to AppleScript, and to Mac OS, (though I have used older UNIX systems, like SunOS and Ultrix, and earlier versions of Linux), and I am trying to understand this script. It doesn't seem to work for me, and my brief inspection of the code makes me think it should be using the move command, but maybe I'm missing what the set name is actually doing? Was something intentionally left out so it doesn't work?

FWIW, I used the list disks command to get my disks, and similar to get the correct path specification. I wasn't sure if I needed to do something to escalate permissions so my regular user login could modify thing in that part of the filesystem?

Also, I added a say command to each section, so I know it is hitting the right section for (in my case) "Work" verses "Home". I am hoping someone, (other than those interested in flaming nubes), can tell me what might be missing, or what I may be misunderstanding?



[ Reply to This | # ]