Control Time Machine from the command line

Launch Terminal app in your /Applications/Utilities folder.

Time Machine on or off 

sudo tmutil enable
sudo tmutil disable

Run a Time Machine backup

tmutil startbackup

Stop a backup

tmutil stopbackup

Save disk space

Time Machine retains “local snapshots,” or files that it will copy to your backup disk the next time it is available. However, these local snapshots take up space, and you may want to turn this feature off if you don’t have much room on your hard disk. You can do so with the following command:

sudo tmutil disablelocal

Running this command will also delete any local snapshots. You can turn local snapshots back on by running:

sudo tmutil enablelocal

If you love delving into the nitty-gritty, and especially if you manage remote Macs, you’ll find this to be a very useful tool.

Exclude files and folders

sudo tmutil addexclusion

The part stands for the path to a file or folder. For example, if I want to exclude my Downloads folder from Time Machine backups, I would run the following:

sudo tmutil addexclusion ~/Downloads

The tmutil addexclusion command has an interesting property: it’s sticky. When you use this command, the item you exclude remains in the Time Machine exclusion list even if you move it, which is not the case when you exclude items from the Time Machine preference pane. If you use the above command with the -pflag, then it will not be sticky, and will be the same as an exclusion you add from the Time Machine preference pane.

Manage remote backups

If you’re managing a remote Mac, such as a server, you may want to change Time Machine settings for that computer. You can start by finding where Time Machine backups are stored. Run this command:

tmutil destinationinfo

You’ll see something like this in Terminal:

Name : MinoTaur
Kind : Local
Mount Point : /Volumes/MinoTaur_TM
ID : A9441A43-83B0-4457-8424-0AFA41F3BF57

To change the destination, you can use two commands. First, remove the current destination like this:

tmutil removedestination

In place of , type in the text string returned by the destinationinfo command. Then run this command to set up a new destination disk:

tmutil setdestination _volume_name_

Replace _volume_name_ with the name of the disk or volume you want to use. You can add multiple destinations as well, since Time Machine can rotate its backups on several disks or volumes. See man tmutil for more on setting up multiple backup destinations.

How do I delete local snapshots to free up space on my Mac’s internal storage?

If you only want to delete a specific local snapshot, you can do so by following these steps in Terminal.
Enter the following command:

tmutil listlocalsnapshots /

This will show you a list of local snapshots, organized by date and time. Find the local snapshot you want to delete and then follow these steps.

Enter the following command:

sudo tmutil deletelocalsnapshots 2019-04-15-082107

Where 2019-04-15-082107 is replaced by the name of your file.
This will delete the specified local snapshot on your Mac. You’ll need to repeat the process for each local snapshot you want to delete. Keeping, at least, the most current local snapshot.

Get Time Machine stats

Time Machine saves a lot of backups: one per hour for the past 24 hours; one a day for the past week; and one a week before that. You can get a list of all the backups on your Time Machine disk with this command:

tmutil listbackups

This will show the full path of each backup.

If you’re curious about how much has changed in your Time Machine backups, there’s a command that will let you find out how much of each backup is new. Run this command to see the delta between each of the Time Machine backups on your backup disk or volume:

tmutil calculatedrift _backup_folder_

Replace _backup_folder_ with the path of the folder containing your backups. This is not the Backups.backupdb folder at the top level of your Time Machine volume, but rather the next folder down; this is generally labeled with your Mac’s name.

I saw data like this:

Here’s what I saw when I ran the tmutil calculatedrift backup_folder command on my Mac.
Note that this command takes a long time to run, as your Mac has to calculate a lot of information.