13

I have a Mac running Time Machine and it has dozens of exclusions that were added through the Time Machine UI.

How can I export this list?

Using tmutil in Terminal, I am able to access Time Machine backups and configuration.

The tool has the following commands related to exclusions:

tmutil addexclusion [-p|-v] item ...
tmutil removeexclusion [-p|-v] item ...
tmutil isexcluded item ...

Is there any way to list the existing exclusions without using isexcluded on specific files and folders?

1 Answer 1

21

Here are 3 ways of getting Time Machines exclusions:

Firstly, every backup includes its own exclusion list. At the top level of each backup there is a hidden file called .exclusions.plist, for example /Volumes/<TM volume name>/2022-05-03-124500/.exclusions.plist. You can see this in Finder so long as you are showing hidden files by pressing Shift and Command and then the dot (or >) key.

The file has exclusions of 4 types:

  • Standard exclusion paths,
  • Sticky exclusion paths set on particular files (lots of these),
  • System files excluded - there are none (I suspect it is a relic from older versions of TM), and
  • User exclusion paths - those set in Time Machine's System Preferences.

So the list you want is at the end of the file.

Howard Oakley's blog has the best reference for the above What doesn't Time Machine back up?

Secondly, Time Machines preference file contains the list of locations added in Time Machine's System Preferences. This is /Library/Preferences/com.apple.TimeMachine.plist.

This preference file does not include individual files with exclusion set or the standard exclusions.

Thirdly, and thanks to @Gordon Davisson, here is a simple one-liner for the exclusions added in the GUI:

defaults read /Library/Preferences/com.apple.TimeMachine SkipPaths
7
  • 2
    You can print the user exclusion paths with defaults read /Library/Preferences/com.apple.TimeMachine SkipPaths. Also, defaults read /Library/Preferences/com.apple.TimeMachine SkipSystemFiles will print "1" if system files are excluded; not sure if it prints "0" or an error if they're not. May 3, 2022 at 4:21
  • @GordonDavisson That is perhaps a better answer! re skipsystemfiles, my Mac says 0.
    – Gilby
    May 3, 2022 at 4:33
  • 4
    I also suggest sudo mdfind "com_apple_backup_excludeItem = 'com.apple.backupd'" because the commands above don't show a completed list for me. Source github.com/stevegrunwell/asimov#how-it-works
    – CAMOBAP
    Sep 26, 2022 at 5:47
  • @CAMOBAP I didn't include that because the question was about listing exclusions added through the GUI. But it is important to know how to list exclusions created as an extended attribute on individual files.
    – Gilby
    Sep 26, 2022 at 10:05
  • Does the .exclusions.plist file still exist? I don't see it in my network Time Machine backup, though I also don't see any list of date folders either. Aug 8 at 14:22

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .