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

10.5: Monitor Time Machine activity via GeekTool System 10.5
I've been having some problems getting Time Machine to work properly, and I've grown tired of opening the Time Machine System Preferences pane just to see if Time Machine executed when it was supposed to. Using GeekTool -- which runs well on Leopard -- I'm now able to get a regular status report effortlessly, which has eased my mind considerably since I now know Time Machine is working properly.

Create a new shell entry in GeekTool, and enter the following command: This scans the system log file for the last three entries from backupd, displaying them on the desktop. Use whatever refresh value you'd like; 10 minutes is good enough for me.

I'm also able to monitor remote Time Machine activity from other computers backing up to a local disk connected to my computer. Just use this command in GeekTool: If you've set up passwordless ssh login, you're golden.

[robg adds: I haven't tested this one.]
    •    
  • Currently 2.80 / 5
  You rated: 5 / 5 (5 votes cast)
 
[30,583 views]  

10.5: Monitor Time Machine activity via GeekTool | 12 comments | Create New Account
Click here to return to the '10.5: Monitor Time Machine activity via GeekTool' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.5: Monitor Time Machine activity via GeekTool
Authored by: dbs on Dec 21, '07 10:15:35AM

In 10.5 you should not use the system.log file for accessing logged events. Instead use the "syslog" program to directly query for new events. Check out "man syslog" to see how to do it. (The system.log file is apparently generated by syslog for backwards compatibility only.)



[ Reply to This | # ]
10.5: Monitor Time Machine activity via GeekTool
Authored by: rjbailey on Dec 21, '07 10:53:43AM

"man syslog" seems to indicate that syslog is a C routine. Not much help here.



[ Reply to This | # ]
10.5: Monitor Time Machine activity via GeekTool
Authored by: CarlRJ on Mar 18, '08 12:04:19PM
syslog is in both section 1 (commands) and 3 (libraries) of the manual. To override the man's guess of which you wanted to see (i.e. get to the page for the syslog command), use: man 1 syslog

[ Reply to This | # ]
10.5: Monitor Time Machine activity via GeekTool
Authored by: freddiepingpong on Jan 02, '08 04:31:45PM

Syslog (full name: Apple System Log Utility) works fine for me. I'm still trying to figure out the usage, but it looks quite powerful.



[ Reply to This | # ]
10.5: Monitor Time Machine activity via GeekTool
Authored by: freddiepingpong on Jan 02, '08 04:54:00PM
Using syslog as suggested above, the query then is:

syslog -F ‘$Message' -k Sender /System/Library/CoreServices/backupd -k Time ge -5m

I got that from http://www.stopbeingcarbon.com/2008/01/time-machine-notification-with-growl/ from a posting on using an Applescript to get a Time Machine Growl notification, which is what I was trying to accomplish.

[ Reply to This | # ]
10.5: Monitor Time Machine activity via GeekTool
Authored by: paole on Sep 07, '09 04:13:35PM
in OS-X.6 Snow-Leopard it has to be:
syslog -F '$Time $Message' -k Sender com.apple.backupd -k Time ge -72h | tail -n 25


[ Reply to This | # ]
10.5: Monitor Time Machine activity via GeekTool
Authored by: mosius on Sep 16, '09 09:32:11PM

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"



[ Reply to This | # ]
10.5: Monitor Time Machine activity via GeekTool
Authored by: gallen1119 on Dec 19, '09 08:52:10PM

mosius,

I like this idea of being able just get the TimeMachine last backup completed, but I'm not sure how to get you reply as GeekTool output. Is this (your post) a script that I paste into AppleScript Editor? How do I get this result as a GeekTool output on my desktop?



[ Reply to This | # ]
10.5: Monitor Time Machine activity via GeekTool
Authored by: PixelRogue on Jan 20, '10 03:27:31PM

Same question:

Would love to have a small Geek Tool desktop item tell me when Time Machine had its last successful backup... no need for all the other activity. Anyone else have some Terminal command to achieve this in Geek Tool?



[ Reply to This | # ]
10.5: Monitor Time Machine activity via GeekTool
Authored by: Aneisch on Jan 29, '10 08:28:35AM

Hey, awesome script, but is there any way to show 12 hour time as opposed to 24?



[ Reply to This | # ]
10.5: Monitor Time Machine activity via GeekTool
Authored by: taylorcc on Dec 04, '10 05:25:39PM

#!/bin/sh

lastbackupdate=$(grep "Backup completed" /var/log/system.log | tail -n 1 | awk '{print $1" "$2" "$3}')

if [ "$lastbackupdate" = "" ] ; then
echo "There has never been a successful backup!"
exit 0
else
date -j -f "%b %d %T" "$lastbackupdate" "+Last successful backup was %a, %b %d %Y, at %I:%m%p"
fi

Gives output like

Last successful backup was Sat, Dec 04 2010, at 06:12PM



[ Reply to This | # ]
10.5: Monitor Time Machine activity via GeekTool
Authored by: Aneisch on Jan 29, '10 08:27:37AM

Hey, awesome script, but is there any way to show 12 hour time as opposed to 24?



[ Reply to This | # ]