Saturday, May 14, 2011

How to change the Default TimeMachine Backup Interval

I have a MacBook at home which I'm using as my main computer. The thing is running Mac OS X 10.6.7 now and one of the great things about OS X is that it has a really easy and trouble free backup program called TimeMachine. That coupled with a piece of hardware called the TimeCapsule really takes the pain out of taking regular backups of your system.
Thanks to this setup I have been able to effortlessly change the Harddrive in my MacBook from a regular HD to an SSD, which btw has immensely boosted the performance of the MacBook.
This post however is not about MacBook performance as much as it is about changing the time interval with which TimeMachine does it's Backups. This setting is fixed and you have no options to change this anywhere in the TimeMachine user interface. However, there is a way to change this .
First off, you probably know that the standard interval is every hour. You can confirm this by executing the following command in a Terminal App window (it will prompt for your account password -the one you use to log into your Mac-):

sudo defaults read /System/Library/LaunchDaemons/com.apple.backupd-auto StartInterval -int


That should give you 3600 which is the interval in seconds.

Now you can also change it by issueing the following command:

sudo defaults write /System/Library/LaunchDaemons/com.apple.backupd-auto StartInterval -int 3600


And while that's great and it works, I thought it 'd be cool and easy (hardly any typing involved) if I could change the interval with a simple graphical interface. So I've cooked up a little bit of AppleScript code and saved it as an App. This App does the heavy lifting for you.
It works by first of all asking for your Password (because the command uses sudo, which requires you to be an administrator of your computer and to input your password for each command that requires elevation of privileges).


Then it will read the current setting and display this in a dialog box that allows you to change it.
Since seconds aren't that intuitive of a time unit to work with, you can simply put in the interval you wish in hours.



And that's it!


You may download this App here.
Its free to use/modify as you see fit.


Note:
For the security conscious people out there, the password is not saved anywhere, it is only used during the running of this script. You can scrutinize the code for yourself by using the AppleScript editor and open the App from within the AppleScript editor.


Happy TimeMachining!

No comments: