Sweepfor Mac

Mac maintenance

How to Exclude Files From Time Machine the Right Way

Stop wasting backup space on files that don't need it. Build a clean Time Machine exclusion list for your Mac with both the GUI and tmutil commands.

8 min read

Your backup drive is full and your Mac says it’s “preparing” the backup for 45 minutes every night. Both problems usually trace to the same cause: Time Machine is faithfully archiving 200 GB of stuff that has no business being in a backup.

The fix isn’t a bigger drive. It’s a better exclusion list.

What Time Machine already excludes

Before you add anything, know what macOS skips automatically:

  • The Trash on every connected volume
  • Anything inside /private/var/vm (swap files, sleep image)
  • iCloud Drive contents that aren’t downloaded locally
  • The system volume on macOS Big Sur and later (it’s read-only and signed)
  • Any file with the com.apple.metadata:com_apple_backup_excludeItem attribute set
  • Any path matching StdExclusions.plist in /System/Library/CoreServices/backupd.bundle/Contents/Resources/

That last file is worth knowing about. It’s where Apple defines system-level skips like temporary folders, log archives, and iOS device support files. You don’t edit it (it’s signed), but reading it shows you what’s already handled.

Two ways to add exclusions

The GUI is friendlier; the command line is faster for bulk additions.

GUI method:

  1. Open System Settings → General → Time Machine
  2. Click Options…
  3. Click the + button at the bottom of the exclusion list
  4. Navigate to and select the file or folder
  5. Click Exclude

The dialog also lets you choose System Files and Applications as a single bulk exclusion if you only want to back up your home folder. Don’t do that — you lose the ability to restore from a single backup.

Terminal method:

sudo tmutil addexclusion -p /path/to/folder

The -p flag makes the exclusion path-based and persistent. Without it, the exclusion lives in extended attributes on the file, which can disappear if you move the file.

To check whether something is excluded:

sudo tmutil isexcluded /path/to/folder

To remove an exclusion:

sudo tmutil removeexclusion -p /path/to/folder

Skip the manual huntSweep clears the system caches, logs, and old installers a backup can’t reach. Download Sweep free →

The exclusion list every developer should have

If you write code on your Mac, these folders are probably 30–50% of your backup size and 100% reproducible:

sudo tmutil addexclusion -p ~/Library/Developer/Xcode/DerivedData
sudo tmutil addexclusion -p ~/Library/Developer/Xcode/Archives
sudo tmutil addexclusion -p ~/Library/Developer/Xcode/iOS\ DeviceSupport
sudo tmutil addexclusion -p ~/Library/Developer/CoreSimulator
sudo tmutil addexclusion -p ~/Library/Caches
sudo tmutil addexclusion -p ~/.npm
sudo tmutil addexclusion -p ~/.cargo
sudo tmutil addexclusion -p ~/.rustup
sudo tmutil addexclusion -p ~/.gradle
sudo tmutil addexclusion -p ~/Library/Caches/Homebrew

For Node.js projects, add a wildcard pattern to your global gitignore mindset and exclude every node_modules folder. There’s no glob support in tmutil, so do it per-project:

find ~/Code -type d -name "node_modules" -prune -exec sudo tmutil addexclusion -p {} \;

Replace ~/Code with wherever you keep projects. The same pattern works for target/ (Rust, Java), build/, dist/, and .next/ directories.

Virtual machines, Docker, and big binary files

VM disk images are the worst offenders. A Parallels VM with a 100 GB disk image gets backed up in full every time you boot it, because the modification date changes.

Exclude them all:

sudo tmutil addexclusion -p ~/Parallels
sudo tmutil addexclusion -p ~/Virtual\ Machines.localized
sudo tmutil addexclusion -p ~/Library/Containers/com.docker.docker
sudo tmutil addexclusion -p ~/.colima

UTM stores VMs in ~/Library/Containers/com.utmapp.UTM/Data/Documents by default — exclude that too if you use UTM.

If your VM holds something irreplaceable, take a snapshot inside the VM before excluding from Time Machine. Don’t rely on Time Machine to save VM state; the disk image is too big and changes too fast.

Apps that churn caches constantly

Some apps rewrite their support files every time they launch, and Time Machine dutifully backs up the new version each hour:

  • Slack~/Library/Application Support/Slack/Service Worker
  • Discord~/Library/Application Support/discord/Cache
  • Chrome~/Library/Caches/Google/Chrome and ~/Library/Application Support/Google/Chrome/Default/Service Worker
  • VS Code~/Library/Application Support/Code/User/workspaceStorage
  • Spotify~/Library/Caches/com.spotify.client
  • Adobe~/Library/Application Support/Adobe/Common/Media Cache Files

The general rule: if the folder name contains “Cache”, “Caches”, “Service Worker”, or “Media Cache”, exclude it. macOS rebuilds them on demand.

Tip: Don't exclude an app's entire `~/Library/Application Support/AppName` folder. That usually contains your settings and documents. Exclude only the cache subdirectories inside it.

Downloads and the temporary file dump

Most people use ~/Downloads as a permanent storage location, which means Time Machine archives every .dmg, .pkg, and .zip you’ve ever downloaded. Decide which it is for you:

  • If Downloads is temporary, exclude it: sudo tmutil addexclusion -p ~/Downloads
  • If Downloads is permanent, leave it included and clean it manually every few months

A middle path: keep Downloads included but exclude ~/Downloads/.tmp and any ~/Downloads/__MACOSX folders that pile up from extracted zip files.

What you should never exclude

Resist the temptation to exclude these:

  • Documents folder — your actual work lives here
  • Desktop — many people use this as a working folder
  • Photos library~/Pictures/Photos Library.photoslibrary is irreplaceable; back it up
  • Mail~/Library/Mail contains your local message store
  • Keychain~/Library/Keychains has your passwords; you need this
  • Calendars and Contacts~/Library/Calendars and ~/Library/Application Support/AddressBook
  • ~/Library/Preferences — settings for every app you’ve configured

If you want a true “minimum recoverable backup,” include everything in your home folder except the obvious caches. Don’t get clever.

Verifying your exclusion list

To see everything currently excluded, you can grep through the Time Machine preferences:

sudo defaults read /Library/Preferences/com.apple.TimeMachine.plist

The relevant keys are ExcludedVolumeUUIDs and the per-destination Exclusions array. It’s noisy, but you’ll find your additions there.

For a cleaner view of what would actually back up next time, run:

sudo tmutil compare -s | tail -50

That shows the largest changes between current state and the last backup. If you see paths you thought you excluded, the exclusion didn’t take or you excluded the wrong path.

Estimating savings before the next backup

Want to know how much space your exclusions actually save? Measure the folders before excluding:

du -sh ~/Library/Developer/Xcode/DerivedData ~/Library/Caches ~/Library/Containers/com.docker.docker 2>/dev/null

Add up the results. That’s roughly what comes out of your next backup. On a typical developer Mac, the answer is somewhere between 30 and 80 GB.

After you add the exclusions, run a manual backup:

tmutil startbackup

The “Calculating size” phase should be noticeably faster, and the actual backup should finish in significantly less time than usual.

Reclaim local snapshot spaceSweep finds APFS local snapshots Time Machine left behind. Get Sweep free →

What Sweep adds to the picture

Exclusions stop Time Machine from copying junk to the backup. They don’t delete the junk from your boot drive — and that’s where Sweep comes in.

You can exclude ~/Library/Caches from backups all you want; macOS still keeps tens of gigabytes of cache there, eating space on your SSD and forcing local APFS snapshots to grow. Sweep finds and clears the categories Time Machine doesn’t manage:

  • System and user caches that won’t auto-clear
  • Old .dmg and .pkg installers in Downloads
  • App support folders left behind after uninstalls
  • Localizations for languages you don’t use
  • Old iOS backups from devices you don’t own anymore
  • Local APFS snapshots past their useful window

It doesn’t replace Time Machine. Time Machine is your “I deleted the wrong file three days ago” insurance. Sweep is what keeps the boot drive lean so the insurance doesn’t have to track 60 GB of files you’d never want restored.

A maintenance habit, not a one-time fix

The exclusion list gets stale. New apps create new cache folders. Old projects get archived but their build artifacts linger. Twice a year, run:

du -sh ~/Library/* 2>/dev/null | sort -h | tail -20

That shows the 20 biggest Library subfolders. Anything new in the multi-GB range is a candidate for exclusion or cleanup.

A clean exclusion list saves backup time, saves drive space, and keeps your restore process predictable. Spend 15 minutes setting it up properly and you’ll get those minutes back every week.

← Back to all guides