brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: tmutil status shows whether Time Machine is backing up right now, in the terminal

Terminal
~/tips/tip-terminal-tmutil-status

tmutil status

Tells you if a backup is running and how far along it is.

The Time Machine icon only spins a little. When you want to know if you can unplug the disk, the terminal gives a clearer answer.

Run it without sudo:

tmutil status

When nothing is happening, the output is short:

Backup session status:
{
    ClientID = "com.apple.backupd";
    Percent = "-1";
    Running = 0;
}

During a backup, Running is 1 and you see a BackupPhase, such as copying or thinning, plus progress figures. I’d check it before closing the lid on a laptop with a backup disk attached.

To watch it, repeat it every few seconds:

while sleep 5; do tmutil status | grep -E 'Running|BackupPhase|Percent'; done

Press Ctrl-C to stop the loop.

One honest warning: status is not in the tmutil man page, even though it has been around for years. The format is a property list meant for Apple’s own tools, and keys can change between macOS versions. Fine for a quick look, risky to build a script on. For scripted checks, the documented tmutil latestbackup is the safer source.

Further reading: tmutil man page (macOS)

More Terminal tips ioreg -rn AppleSmartBattery | grep CycleCount Terminal can save your windows and tabs as a window group Export a Terminal profile to a .terminal file and import it on another Mac mc hidutil property --set '{"UserKeyMapping":[{"HIDKeyboardModifierMappingSrc":0x700000039,"HIDKeyboardModifierMappingDst":0x700000029}]}' All Terminal tips (116) All topics

Link