# tmutil — Control Time Machine Backups

> Practical guide to tmutil: control Time Machine from the command line — start backups, manage snapshots, set destinations and restore files.

Source: https://www.jpkc.com/db/en/cheatsheets/macos/tmutil/

<!-- PROSE:intro -->
tmutil controls Apple's Time Machine straight from the command line – you start and stop backups, set backup destinations, manage local APFS snapshots and restore individual files without going through System Settings. That makes it especially handy for scripts, maintenance routines and headless server Macs without a logged-in user. This guide walks you through the subcommands you reach for daily, from backup control to targeted restores.
<!-- PROSE:intro:end -->

## Backup Control

`tmutil startbackup` — Start a Time Machine backup immediately.

```bash
sudo tmutil startbackup
```

`tmutil startbackup --auto` — Start an automatic backup (can be deferred by the system).

```bash
sudo tmutil startbackup --auto
```

`tmutil startbackup --block` — Start a backup and wait until it finishes.

```bash
sudo tmutil startbackup --block
```

`tmutil stopbackup` — Stop a running backup.

```bash
sudo tmutil stopbackup
```

`tmutil enable` — Enable automatic Time Machine backups.

```bash
sudo tmutil enable
```

`tmutil disable` — Disable automatic Time Machine backups.

```bash
sudo tmutil disable
```

## Status & Info

`tmutil status` — Show the current Time Machine backup status.

```bash
tmutil status
```

`tmutil currentphase` — Show the current phase of a running backup.

```bash
tmutil currentphase
```

`tmutil listbackups` — List all available backups (paths).

```bash
tmutil listbackups
```

`tmutil latestbackup` — Show the path of the most recent backup.

```bash
tmutil latestbackup
```

`tmutil destinationinfo` — Show information about backup destinations.

```bash
tmutil destinationinfo
```

`tmutil machinedirectory` — Show the machine-specific backup directory path.

```bash
tmutil machinedirectory
```

## Snapshots

`tmutil localsnapshot` — Create a new local APFS snapshot.

```bash
sudo tmutil localsnapshot
```

`tmutil listlocalsnapshots /` — List all local snapshots on a volume.

```bash
tmutil listlocalsnapshots /
```

`tmutil listlocalsnapshotdates` — List dates of all local snapshots.

```bash
tmutil listlocalsnapshotdates
```

`tmutil deletelocalsnapshots <date>` — Delete a specific local snapshot by date.

```bash
sudo tmutil deletelocalsnapshots 2026-03-19-120000
```

`tmutil thinlocalsnapshots / <bytes>` — Delete local snapshots until the specified space is freed.

```bash
sudo tmutil thinlocalsnapshots / 10000000000
```

## Exclude & Include

`tmutil addexclusion <path>` — Exclude a path from Time Machine backups (sticky, follows path).

```bash
sudo tmutil addexclusion ~/VMs
```

`tmutil addexclusion -p <path>` — Exclude a fixed path (does not follow if renamed).

```bash
sudo tmutil addexclusion -p /usr/local/var/mysql
```

`tmutil removeexclusion <path>` — Remove an exclusion.

```bash
sudo tmutil removeexclusion ~/VMs
```

`tmutil isexcluded <path>` — Check if a path is excluded from backups.

```bash
tmutil isexcluded ~/VMs
```

## Destinations

`tmutil setdestination <path>` — Set the backup destination (replaces existing).

```bash
sudo tmutil setdestination /Volumes/BackupDrive
```

`tmutil setdestination -a <path>` — Add an additional backup destination.

```bash
sudo tmutil setdestination -a /Volumes/SecondBackup
```

`tmutil removedestination <id>` — Remove a backup destination by its ID.

```bash
sudo tmutil removedestination XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
```

## Restore & Delete

`tmutil restore <src> <dest>` — Restore a file or directory from a backup.

```bash
sudo tmutil restore '/Volumes/Backup/2026-03-19/Users/me/file.txt' ~/file.txt
```

`tmutil delete <backup-path>` — Delete a specific backup snapshot.

```bash
sudo tmutil delete /Volumes/Backup/Backups.backupdb/Mac/2026-03-01-120000
```

`tmutil calculatedrift <backup-path>` — Show the amount of data changed between backups.

```bash
tmutil calculatedrift /Volumes/Backup/Backups.backupdb/Mac
```

`tmutil compare <backup1> <backup2>` — Compare two backups or a backup with the current disk.

```bash
tmutil compare /Volumes/Backup/Backups.backupdb/Mac/2026-03-18 /Volumes/Backup/Backups.backupdb/Mac/2026-03-19
```

<!-- PROSE:outro -->
## Conclusion

tmutil gives you full control over Time Machine – invaluable in scripts and on remote Macs. Be aware, though, that some subcommands are irreversible: `delete` and `deletelocalsnapshots` remove backups and snapshots permanently, and many operations require `sudo`. Always double-check the target and path before deleting anything or setting a new destination – a mistyped path can hit the wrong backup. For everyday use, `startbackup`, `status` and `listbackups` are usually all you need; keep the destructive commands for deliberate cleanup.

## Further Reading

- [Back up your Mac with Time Machine](https://support.apple.com/en-us/HT201250) – official Apple guide to Time Machine
- [tmutil(8) – man page](https://ss64.com/mac/tmutil.html) – complete reference of all subcommands
<!-- PROSE:outro:end -->

## Related Commands

- [caffeinate](https://www.jpkc.com/db/en/cheatsheets/macos/caffeinate/) – prevent the Mac from going to sleep
- [defaults](https://www.jpkc.com/db/en/cheatsheets/macos/defaults/) – read and write macOS preferences (property lists)
- [diskutil](https://www.jpkc.com/db/en/cheatsheets/macos/diskutil/) – manage disks, volumes and partitions

