tmutil

tmutil is the command line tool to interact with your Time Machine backups. The graphical user interface is good in most of the cases, but not all, it’s a bit limited; when you need to tweak more you can use tmutil from Terminal.

If you simply type tmutil in Terminal, it will print out all the options, parameters

% tmutil
Usage: tmutil version

Usage: tmutil enable

Usage: tmutil disable

Usage: tmutil startbackup [-a | --auto] [-b | --block] [-r | --rotation] [-d | --destination dest_id]

Usage: tmutil stopbackup

Usage: tmutil delete backup_path ...

Usage: tmutil deleteinprogress machine_directory

Usage: tmutil restore [-v] src ... dst

Usage: tmutil compare [-@acdefghlmnstuEX] [-D depth] [-I name]
       tmutil compare [-@acdefghlmnstuEX] [-D depth] [-I name] snapshot_path
       tmutil compare [-@acdefghlmnstuEUX] [-D depth] [-I name] path1 path2

Usage: tmutil setdestination [-a]  mount_point
       tmutil setdestination [-ap] afp://user[:pass]@host/share

Usage: tmutil removedestination destination_id

Usage: tmutil destinationinfo [-X]

Usage: tmutil addexclusion [-p|-v] item ...

Usage: tmutil removeexclusion [-p|-v] item ...

Usage: tmutil isexcluded item ...

Usage: tmutil inheritbackup machine_directory
       tmutil inheritbackup sparse_bundle

Usage: tmutil associatedisk [-a] mount_point volume_backup_directory

Usage: tmutil latestbackup [-t] [-d mount_point]

Usage: tmutil listbackups [-mt] [-d mount_point]

Usage: tmutil machinedirectory

Usage: tmutil calculatedrift machine_directory

Usage: tmutil uniquesize path ...

Usage: tmutil verifychecksums path ...

Usage: tmutil localsnapshot

Usage: tmutil listlocalsnapshots <mount_point>

Usage: tmutil listlocalsnapshotdates [<mount_point>]

Usage: tmutil deletelocalsnapshots [<mount_point> | <snapshot_date>]

Usage: tmutil thinlocalsnapshots <mount_point> [purgeamount] [urgency]

Here are a few examples with the commands I use most of the time:

% tmutil latestbackup
/Volumes/Time Machine Backups/Backups.backupdb/laci/2021-01-25-150509

% tmutil listbackups
2020-01-09-050619
2020-01-15-183554
2020-01-22-181303
2020-02-01-095410
2020-02-09-085259
2020-02-17-191440
.
.
2020-12-12-121821
2020-12-21-203733
2021-01-25-150509

% sudo tmutil delete -d /Volumes/Time\ Machine\ Backups -t 2020-01-09-050619
Total deleted: 1.95 GB

Yes, to delete you have to use sudo. Depending on resources, your backup drive, or network drive it can take quite many minutes (the above delete for 1.95GB took me ~10minutes via WiFi and an older storage server). You can always press ctrl+T if you’d like to see what’s happening, I wrote more about this here: The Power Of Ctrl+T.

If your are running macOS Catalina (or higher) macOS is going to ask if you give Full Disk Access to Terminal, that is expected.

System Preferences → Security & Privacy

For safety reasons I only gave Terminal Full Disk Access and not to iTerm (my preferred terminal application).

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.