Skip to content
macOSHow-To Published Updated 4 min readViews unavailable

Managing Time Machine From the Command Line with tmutil

Starting, stopping, inspecting, and restoring Time Machine backups without the GUI — useful for scripting backups or diagnosing a stuck one.

Time Machine’s GUI in System Settings covers the common cases well enough, but tmutil — the command-line tool underlying it — gives direct access to functionality the GUI doesn’t expose at all, and is the more practical option for scripting backups or diagnosing a backup that’s behaving unexpectedly.

Checking current backup status

tmutil status

This reports whether a backup is currently running, and if so, its phase (Copying, Preparing, Finding Changes, and others) and progress — considerably more granular and immediately available than the GUI’s summary view, particularly useful when trying to determine whether a backup that seems to be taking an unusually long time is actually still making progress.

Starting and stopping backups manually

tmutil startbackup
tmutil stopbackup

startbackup triggers an immediate backup outside of Time Machine’s normal automatic schedule, useful before a risky system change when you want a fresh restore point without waiting for the next scheduled backup. The --auto flag (tmutil startbackup --auto) triggers a backup only if conditions that would normally trigger one automatically are actually met, useful for scripted/cron-triggered backup attempts that shouldn’t force a backup outside Time Machine’s own normal heuristics.

Listing available backups

tmutil listbackups

This lists every available backup snapshot with its full timestamped path, which is useful both for scripting (referencing a specific backup programmatically) and for confirming exactly how far back your backup history actually extends on a specific destination.

Comparing what changed between two backups

tmutil compare -a

This compares the two most recent backups and reports exactly what files were added, removed, or modified between them — genuinely useful for understanding what a specific backup actually captured, or diagnosing unexpectedly large backup sizes by seeing precisely what changed.

Restoring a specific file without the Time Machine GUI

While the full-screen Time Machine restore interface is the common path for browsing and restoring interactively, tmutil restore handles direct, scriptable single-file or directory restores when you already know exactly what you want restored and from where:

tmutil restore "/Volumes/Time Machine Backups/Backups.backupdb/MacName/2026-07-01-120000/Macintosh HD/Users/name/Documents/file.txt" "/Users/name/Documents/file.txt"

This is considerably more direct than navigating the visual Time Machine restore interface when you already know the specific backup and file path involved, particularly useful in a scripted recovery workflow.

Managing local snapshots directly

Time Machine on APFS-formatted internal storage maintains local snapshots even without an external backup destination attached, and these can be listed and managed directly:

tmutil listlocalsnapshots /
tmutil deletelocalsnapshots <snapshot-date>

Manually deleting local snapshots is occasionally necessary when they’re consuming meaningful disk space and you need to reclaim it immediately, rather than waiting for macOS’s own automatic purging (which normally happens as disk space pressure increases, but isn’t always fast enough for an urgent, immediate space need).

Excluding specific paths from backup via the command line

tmutil addexclusion /path/to/exclude
tmutil isexcluded /path/to/check

addexclusion is functionally equivalent to the GUI’s “Exclude these items” list in Time Machine settings, but scriptable — useful for consistently applying the same exclusion list across multiple Macs via a setup script rather than manually configuring each machine’s exclusions through the GUI individually.

Why the command-line tool matters beyond just convenience

Several of these capabilities — granular phase-level status, direct backup comparison, scriptable exclusion management — simply aren’t exposed anywhere in the GUI at all, making tmutil not just a faster alternative to clicking through System Settings but the only way to access certain Time Machine functionality directly, particularly for anyone managing backup configuration across multiple Macs or needing to diagnose backup behavior more precisely than the GUI’s simplified status view allows.

Disabling and re-enabling Time Machine entirely from the command line

sudo tmutil disable
sudo tmutil enable

Beyond pausing or triggering an individual backup, tmutil can turn Time Machine’s automatic scheduling off entirely — genuinely useful for a machine where you want full manual control over exactly when backups happen (a laptop where you’d rather not have a large backup start unexpectedly during a metered or slow connection, for instance), reserving startbackup for deliberately-triggered runs only, rather than fighting the normal automatic schedule repeatedly.

Changing or checking the configured backup destination directly

tmutil destinationinfo
sudo tmutil setdestination /Volumes/NewBackupDrive

destinationinfo reports every currently configured backup destination along with identifying details (its unique ID, kind, and mount point) — useful for scripted verification that a specific expected destination is actually configured correctly, particularly across a fleet of Macs where you want to confirm consistent backup configuration without manually opening System Settings on each individual machine.

Setting backup frequency beyond the default hourly schedule

sudo defaults write /Library/Preferences/com.apple.TimeMachine.plist Interval -int 1800

While not a dedicated tmutil subcommand, the same defaults-based preference-editing approach covered elsewhere on this blog applies directly to Time Machine’s own scheduling — adjusting the backup interval away from the default hourly cadence (in seconds here, 1800 for every 30 minutes) for a workflow that specifically wants more frequent snapshots than the default provides, at the cost of correspondingly more frequent background disk activity.

Related:

Sources:

Comments