Exclude a Folder from Time Machine with tmutil addexclusion

Keep volatile folders like VM images and caches out of every backup.

macOSbackupstoragetmutiltime-machineMedium risk
Run `sudo tmutil addexclusion -p /path/to/folder` to add a persistent exclusion.

01Command

Command
$ sudo tmutil addexclusion -p "/Users/apple/Downloads/虚拟机镜像"

02What it does

Excluding fast-changing folders dramatically reduces backup size and duration, since Time Machine otherwise copies a new version of every changed file each hour. The `-p` flag makes the exclusion “sticky”, meaning it survives on the folder even if it is moved or the backup disk changes; without `-p` the exclusion is fixed to the path only.

03Risk

RiskMedium risk
!Warning: The path is excluded as-is with no warning dialog — double-check it before running. Excluded data will have no backup at all, so never exclude your only copy of important files.

04Undo

Undo
$ sudo tmutil removeexclusion "/Users/apple/Downloads/虚拟机镜像"

05Sources

Last verified: 2026-09-18 · Category: System & Settings

06Related solutions