tmutil

On this page 8

tmutil is the command-line interface to Time Machine in macOS, the built-in backup system. In the Terminal & scripting toolkit it lets an administrator start and stop backups, configure backup destinations, manage exclusions and inspect or delete local snapshots without opening System Settings.

Because every action is a single shell command, tmutil fits naturally into scripts, launch daemons and MDM workflows. It is the standard way to verify backup health on many Macs at once, to automate backups before risky changes and to recover space taken by APFS local snapshots.

How tmutil drives Time Machine

tmutil does not copy files itself; it sends requests to the backupd daemon, the background process that performs every Time Machine backup. Settings live in the com.apple.TimeMachine preference domain, so tmutil changes the same configuration that the graphical interface shows.

Since macOS Big Sur, Time Machine writes to APFS-formatted destinations and records each backup as an APFS snapshot, which makes incremental runs faster and more reliable than the older HFS+ hard-link design. Network backups are stored inside a sparse bundle disk image on the server, while local snapshots stay on the startup volume.

Most commands that change state require administrator privileges via sudo. Commands that read backup contents also need Full Disk Access granted to Terminal or to the calling agent; without it, tmutil returns permission errors even when run as root.

Core tmutil verbs and what they do

tmutil uses a verb-based syntax in which the first argument names the operation. The table below groups the verbs that administrators use most often.

VerbPurposeNeeds sudo
startbackupBegins a backup; --block waits until it endsNo
stopbackupCancels the backup in progressNo
enable / disableTurns automatic backups on or offYes
setdestinationSets or adds (-a) a backup disk or shareYes
destinationinfoLists configured destinations and their IDsNo
addexclusionExcludes a file, folder or volumeSometimes
listbackupsLists completed backups on the destinationNo
statusReports the phase and progress of a running backupNo
Frequently used tmutil verbs

Two further groups matter in practice. Snapshot verbs such as localsnapshot, listlocalsnapshots and deletelocalsnapshots handle point-in-time copies on the internal disk. Analysis verbs such as compare, uniquesize and calculatedrift show what changed between backups and how much space each one uniquely occupies.

Exclusions and local snapshots

tmutil supports two kinds of exclusion, and confusing them is a common source of surprises. A default addexclusion call writes an extended attribute to the item, so the exclusion follows the file when it moves. The -p option instead records a fixed path in the preferences, which excludes whatever occupies that location later.

Exclusion typeHow it is storedBehavior when the item moves
Sticky exclusionExtended attribute on the itemRemains excluded at the new location
Fixed-path exclusion (-p)Path list in preferencesItem is backed up again at the new location
Volume exclusion (-v)Volume entry in preferencesWhole volume stays out of backups
Comparison of exclusion types

Local snapshots are APFS snapshots that Time Machine keeps on the startup disk, typically for about 24 hours, so recent versions remain available while the backup disk is disconnected. macOS purges them automatically under storage pressure, but tmutil thinlocalsnapshots and deletelocalsnapshots let an administrator reclaim space immediately, for example before a large installer runs.

tmutil is one of several single-purpose administration utilities in macOS, and choosing the right one avoids awkward workarounds. The comparison below places it beside neighbors that administrators often combine with it.

ToolMain domainTypical pairing with tmutil
tmutilTime Machine backups and snapshotsPrimary backup control
diskutilDisks, volumes and APFS containersPrepares and formats the backup disk
defaultsPreference domainsReads Time Machine settings directly
launchctllaunchd jobs and servicesSchedules scripts that call tmutil
caffeinateSleep preventionKeeps a Mac awake during a long backup
tmutil and neighboring command-line tools

Unlike general file-copy tools such as rsync, tmutil preserves the versioned history that the Time Machine browser and Migration Assistant understand. A copy made with another tool is not a Time Machine backup and cannot be restored through the standard recovery flow.

Scripting and fleet use

In managed environments tmutil is most valuable as a monitoring and remediation tool. MDM extension attributes and compliance scripts typically call tmutil latestbackup or tmutil destinationinfo and flag any Mac whose last successful backup is older than a set threshold.

Situationtmutil approachReason
Before a major upgradestartbackup --auto --blockGuarantees a fresh restore point
Compliance reportinglatestbackup plus date parsingDetects Macs that stopped backing up
Low disk space alertsthinlocalsnapshots / with a sizeFrees space without disabling backups
New network sharesetdestination -p with a URLPrompts for credentials securely
Common automation tasks

Scripts should check exit codes and treat empty output carefully, because several verbs print nothing when no destination is reachable. Embedding a password directly in setdestination is a serious credential risk; the -p prompt or a managed configuration profile is the safer choice.

Limitations and common mistakes

tmutil is powerful but has sharp edges, especially on recent macOS releases where privacy controls tightened. The most frequent problems are listed below.

  • Missing Full Disk Access causes listbackups or compare to fail with misleading permission errors.
  • Deleting backups with Finder instead of tmutil delete can damage the backup set; use the tool or the Time Machine interface.
  • Assuming local snapshots are backups: they live on the same disk and disappear if that disk fails.
  • Relying on removed verbs: some options from the HFS+ era behave differently or are unsupported on APFS destinations.
  • Running startbackup without –block in a script, which lets the script continue before the backup has finished.

Finally, tmutil only reports what backupd knows. A destination that mounts but contains a corrupted sparse bundle can still appear healthy, so periodic test restores remain the only real proof that backups work.

A non-technical view

Time Machine is the backup feature that comes with every Mac. Normally you control it with buttons in System Settings. tmutil is the typed version of those buttons. You write a short command in Terminal, and the Mac starts a backup, changes the backup disk or skips a folder.

Think of it like a remote control for a recorder. The recorder does the work. The remote just tells it what to do. This matters most for people who look after many Macs, because one command can check or fix backups on every computer at once.

A concrete example

An IT team at a design studio manages 60 Macs that back up to a network share. Their MDM runs a nightly script that calls tmutil latestbackup, extracts the date and marks any Mac whose newest backup is more than seven days old as noncompliant.

One week the report flags eight laptops. The administrator runs tmutil destinationinfo remotely and finds that the share address changed after a server move. A second script calls sudo tmutil setdestination -p with the new address on those machines, then tmutil startbackup --auto --block. By the next morning all eight Macs report fresh backups, and no user had to open System Settings.