Tag Archives: Time Machine

Scheduling Time Machine Backups with AppleScript and iCal

Great news to all Time Machine users! It’s actually possible to schedule when you allow backups to happen. Problem has been that Time Machine tends to go on at times when it’s really not that convenient; when your working on something heavy and don’t want the extra CPU usage or when you need to leave your flat but don’t want to abruptly stop it backing up (latter can be really harmful to your backup so should be avoided). Two lines of AppleScript and few iCal events will fix this!

Few easy steps:

The Script

1: Open Script Editor.app from Macintosh HD/Applications/

2: copy and paste this in to the window:
do shell script "defaults write /Library/Preferences/com.apple.TimeMachine AutoBackup -bool true"

3: Save As: “TM-On” in Macintosh HD/Library/Scripts/Time Machine/

You don’t need to change the defaults

4: Open a new document in Script Editor

5: copy and paste this in to the window:
do shell script "defaults write /Library/Preferences/com.apple.TimeMachine AutoBackup -bool false"

6: Save As: “TM-Off” in Macintosh HD/Library/Scripts/Time Machine/

In iCal

(As there’s going to be repeating calendar entries for every day I’d suggest adding a new calendar so you can hide it.)

1: Create a new calendar entry for today.

2: Decide what time you want to turn Time Machine on. I’ve set it to 13:00 so it’ll be on when I get home. Also set it to repeat daily.

3: Set Alarm to Run Script and underneath File… and browse to /Macintosh HD/Library/Scripts/Time Machine/TM-On.scpt

4: Set it to go 1 minute before the event (if you set it to ‘on date‘, repeat wont work)

5: Repeat above steps for turning Time Machine of and you’re done. I’m turning mine off in the wee hours of the morning but if you like watching stuff on you laptop in bed you might want to turn it off – say – 21:00 so it won’t be backing up when you want to go to sleep.

6: Relax… or watch the video below. It shows how this is done in about 4 minutes. Click here to watch this video in HD on Vimeo.

[Update 1] If you’re having problems using this, it might be that you don’t have a .plist for Time Machine. As odd as it sounds, Darina’s MacBook was missing this completely. In order to create it, just go to TM preferences and add something to the excluded list. This will create a file called com.apple.TimeMachine.plist in your systems main library.

Aperture and Time Machine not Sitting in a Tree

Hope Apple fixes this quickly.

After getting a Time Capsule, I’ve started liking Time Machine again. No need to plug in a cable makes a massive difference. Difference between remembering to use it sometimes (I used to share a drive with Darina) and not having to remember to use it, ever.

However, Time Machine doesn’t seem to like Aperture that much, it wants to back up the whole library every single time there’s a change. Apple acknowledges it and suggest turning of Time Machine when using Aperture. I’m not sure if the problem is solved as long as they’re not running at the same time but will try it as soon as these 14.9 gigabytes of images have flown across my flat.

Taking Murphy’s Law into count, there’s a possibility of 2.45/31 for the HDD to die 16 days after turning Time Machine off.

–kristian