How Do I Tell When Time Machine Starts/Stops?

###How Do I Tell When Time Machine Starts/Stops?

I'm trying to build a macro that will notify me when a TM backup starts and stops, but the backup does not seem to use the "Time Machine.app".

So how do I trigger the macro?

Next, I'd like to display a report like is shown in the Console. Any ideas on how I might do this?

###OR

If there is already an app/utility that will do what I want the macro to do, I would be just as happy with that.

TIA for your help and suggestions.

MACRO: [TM] Notify When Time Machine Starts/Stops

[TM] Notify When Time Machine Starts-Stops.kmmacros (3.2 KB)

I do not know if this helps.
But on my system a process called backupd is running when TimeMachine backups up.

Do not know if you can trigger on when this launches.

Another way could be to make a periodic trigger, which uses this shell script to get the status

tmutil status

It gives this output:

   Backup session status:
{
    BackupPhase = Copying;
    ClientID = "com.apple.backupd";
    DateOfStateChange = "2016-03-15 08:25:55 +0000";
    DestinationID = "ED6A22DE-BD05-4AD5-9CCE-C93514364185";
    DestinationMountPoint = "/Volumes/TimeMachine JH";
    Percent = "0.5655844213911085";
    Progress =     {
        TimeRemaining = 261;
        "_raw_totalBytes" = 3818142147;
        bytes = 2399424130;
        files = 74915;
        totalBytes = 4199956361;
        totalFiles = 74915;
    };
    Running = 1;
    Stopping = 0;
    "_raw_Percent" = "0.6284271348790095";
}

When Running = 1 then it is running.

On my system I have Geektool (http://projects.tynsoe.org/en/geektool/) installed.
With this I have a circle filling when Time Machine is running.
To do this, you need this geeklet: Timemachine.glet.zip (2.3 KB)
And this font: font3933.ttf.zip (2.6 KB)
It originally comes from Brett Terpstra: http://brettterpstra.com/2013/12/24/a-geektool-time-machine-progress-indicator/

2 Likes

Time Machine.app, as far as I know, is only the GUI app for browsing the backup and restoring. As Jimmy said, the Time Machine process is backupd.

For fetching the log you can do this

syslog -F '$Time $Message' -k Sender com.apple.backupd -k Time ge -60m

So, in conjunction with a periodic tmutil status check something roughly like this could work:


Edit [18:23]:

The macro was running on my machine for the last 6 hours and it seems to work. Of course it has to be refined.

Time Machine Monitor [raw draft].kmmacros.zip (1.5 KB)

Obviously it is not a real-time report. But for that you probably would have to constantly grep system.log (or whatever) for keywords and time stamps, which will be costly.

I’m sure there exists a more elegant solution…

1 Like

Thanks @JimmyHartington and @Tom. Both of your suggestions were very helpful, and enabled me to move forward.