|
|
|
10.5: Monitor Time Machine activity via GeekTool
I found a way to get just the last time a backup was complete. I wasn't too concerned with all the activity, I just wanted to know when it was last completed.
There's some basic timezone support and the way I laid it out I think you could figure out how to customize the format of the date output fairly easily. #! /bin/sh # Your computer's timezone offset OFFSET=`date "+%z" | cut -c 1-3` # All the following is in ZULU (GMT) time YEAR=`grep -m 1 "<date>" /private/var/db/.TimeMachine.Results.plist | cut -c 8-11` MONTH=`grep -m 1 "<date>" /private/var/db/.TimeMachine.Results.plist | cut -c 13-14` DAY=`grep -m 1 "<date>" /private/var/db/.TimeMachine.Results.plist | cut -c 16-17` ZULU_HOUR=`grep -m 1 "<date>" /private/var/db/.TimeMachine.Results.plist | cut -c 19-20` MINUTE=`grep -m 1 "<date>" /private/var/db/.TimeMachine.Results.plist | cut -c 22-23` SECOND=`grep -m 1 "<date>" /private/var/db/.TimeMachine.Results.plist | cut -c 25-26` # Corrects for your computer's timezone HOUR=`expr $ZULU_HOUR + $OFFSET` # If the TZ shift rolled you back a day you have to adjust the DAY # If the Day rolls to 0, I didn't bother with the roll back because of the huge issues # of which month you roll back on and what not. The proper solution would be to do proper # date math, but I haven't figured out how to do that in shell unless you're using the # current system time. But here, I'm using a generated time. if [ $HOUR -lt 0 ] ; then HOUR=`expr '24' + $HOUR` DAY=`expr $DAY - '1'` fi # Just for formatting. It adds the preceding zero to the number if it's a single digit. if [ $HOUR -lt 10 ] ; then HOUR=`echo 0$HOUR` fi echo "$MONTH.$DAY $HOUR:$MINUTE" |
SearchFrom our Sponsor...What's New:HintsNo new hintsComments last 2 days
Links last 2 weeksNo recent new linksWhat's New in the Forums?
The Editor's Corner...Here are some of my (robg) other projects...
Hints by TopicNews from Macworld
The macosxhints PollWhat version of OS X are you running as your main OS?
Other polls | 11,410 votes | 42 comments
|
|
Copyright © 2009 Mac Publishing LLC (Privacy Policy) Contact Us All trademarks and copyrights on this page are owned by their respective owners. |
Visit other IDG sites: |
|
|
|
Powered by Geeklog Created this page in 0.56 seconds |
|