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!

Some more speedtest results

Tried again today and have gotten better results, at least more in line with what I should be getting.
Have a look:
Still not exactly the 60Mb/s but getting closer. Its a Saturday afternoon, so probably not too many other contenders on the net here...

Friday, May 13, 2011

Cool Bash One Liner; extracting a value from command output

Here's a cool 1-liner to find the partition that has the least amount of free space. The command will simply return the number representing the percentage used on that partition (with the most amount of space used).

Here it is:

df -h | grep -Eo [0-9]+% | sort -n | tail -1 | cut -d "%" -f1


To break if down:

  1. the "df -h" command shows you disk free info of all your partitions in human readable form
  2. the "grep -Eo [0-9]+%" command takes the output of the previous command and returns a list with only the percentages. It does this based on the -E option which stands for Extended Regex and the -o option which outputs only those characters that match the Regex.
  3. the "sort -n" command then takes the output from the previous command and sorts it ascending
  4. the "tail -1" command then takes the output from the previous command and shows only the last 1 line
  5. the "cut -d "%" -f1 cuts of the percentage sign, leaving you only with the number
The output of this could be used in another script that perhaps runs as a cron job every few times a day and based on the result, sends you an email. You can use your imagination I'm sure to see how this could be useful.

Happy Bashing!

My Telenet Performance

For those interested, I've down another SpeedTest at 19:38 on a Friday night. I suppose this could be a time that there are a lot of other surfers in my area, so in that light I suppose the results aren't that bad.
However, I'm getting only half the DL speed I should be getting.
This may however have something to do with my setup, so I'm going to do another post shortly, testing straight from my Telenet WiFi hotspot.

The mysteriously disappearing Share Buttons

Ok, long time no post.
I'm now posting a very short entry simply to check if my share buttons are showing up.

[Edit]
Ok, turns out they didn't appear. I had to reset the widgets template to default in the Design/HTML section of blogger.com for my blog. Lo n behold, they now appear!
[End Edit]