Exclude a Folder from Time Machine with tmutil addexclusion
Keep volatile folders like VM images and caches out of every backup.
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
!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
- Use Time Machine on MacEvidence: Apple Time Machine documentation
- tmutil – Time Machine utilityEvidence: Documents addexclusion/removeexclusion, including the sticky -p flag
Last verified: 2026-09-18 · Category: System & Settings
06Related solutions
List Local Time Machine Snapshots with tmutil
See every local APFS Time Machine snapshot on your startup disk and delete ones you no longer need.
Clone Folders with Full macOS Metadata Using ditto
The copy command that keeps Finder flags, ACLs, resource forks, and exact permissions intact.
Export and Import Preference Domains with defaults
Snapshot an entire app's settings to a plist file, then restore or migrate it later.