20

The Time Machine control panel gives information on in-progress backups. For example

enter image description here

Is there a way to get the information from the command line?

30

While the backup is running, detailed information gan be gained by

tmutil status

which should return something like this:

Backup session status:
{
    BackupPhase = Copying;
    ClientID = "com.apple.backupd";
    DateOfStateChange = "2014-12-18 14:14:21 +0000";
    DestinationID = "B4AF88-5AD5-49BE-B254-650B44E20499";
    DestinationMountPoint = "/Volumes/TimeMachine";
    Percent = "0.852581430477103";
    Progress =     {
        TimeRemaining = 0;
        "_raw_totalBytes" = 38596759;
        bytes = 36563200;
        files = 480;
        totalBytes = 42456434;
        totalFiles = 480;
    };
    Running = 1;
    Stopping = 0;
    "_raw_Percent" = "0.9473127005301144";
}

If you only care for the percentage, try the following (looks ugly, works only if there is a percentage to display):

tmutil status | awk '/_raw_Percent/ {print $3}' | grep -o '[0-9].[0-9]\+' | awk '{print $1*100}'
  • 2
    I couldn't find this in the manpage. Where did you glean this verb for tmutil? – jsejcksn Dec 8 '16 at 2:38
  • 4
    @jsejcksn To be honest, I don't remember where I found out about status, running tmutil help status now returns *** status is a private verb. ***; why this is the case and especially if this was the case two years ago, I don't know :D – Asmus Dec 9 '16 at 9:42
  • 2
    What is the format of the data from tmutil? It's not quite JSON. Is it some kind of C object dump? – L S Jan 27 '18 at 16:44
  • 4
    @LS this is formatted as a NeXTSTEP-style property list – Asmus Feb 5 '18 at 9:07
1

To get only the percentage value:

tmutil status | awk -F'"' '/_raw_Percent/ {print $4*100}'

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .