Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

BijouMan

macrumors member
Original poster
May 16, 2022
62
11
I could not get my Time Machine to work for a very long time. It would always tell me that some System or Library file could not be backed up. I would use tmutil to exclude that file, and then it would complain about another one, so I would exclude that, and then it would complain about still another one. I kept reformatting the drive I was using, removing it from Time Machine and readding it, but none of these worked and I still kept getting the same error at the same number of GB in the backup process. Eventually I tried backing up to a different drive and it backed up all the way through with no problems. Then I tried the drive that I had been using before, and this time, it worked perfectly with that one too. Now I want to remove any exclusions that I may have made before I got it working. Is there any way to do this? I look at the .exclusions.plist file in my backups and there are way too many files mentioned and I cannot tell which ones are the ones I added.
 
Have not done this myself, but this might work:

Code:
defaults read /Library/Preferences/com.apple.TimeMachine SkipPaths | grep '"' | sed "s/,$//" | sed "s/^/tmutil removeexclusion /" | zsh
 
  • Like
Reactions: adrianlondon
Have not done this myself, but this might work:

Code:
defaults read /Library/Preferences/com.apple.TimeMachine SkipPaths | grep '"' | sed "s/,$//" | sed "s/^/tmutil removeexclusion /" | zsh
Code:
The domain/default pair of (/Library/Preferences/com.apple.TimeMachine, SkipPaths) does not exist
 
Have not done this myself, but this might work:

Code:
defaults read /Library/Preferences/com.apple.TimeMachine SkipPaths | grep '"' | sed "s/,$//" | sed "s/^/tmutil removeexclusion /" | zsh
"SkipPaths" or "userExclusionPaths" are paths added in System Settings or TM GUI. But the OP said:
I would use tmutil to exclude that file
These exclusions are not added to SkipPaths. Rather they are metadata added to the specific file or folder.

tmutil exclusions are found with:

sudo mdfind "com_apple_backup_excludeItem = 'com.apple.backupd'"

They are also included in /Volumes/<TM Volume>/<date-time>.backup/.exclusions.plist as "stickyExclusionPaths".

@NoBoMac can you change your command to use mdfind? Your grep and sed skills are better than mine!

But @BijouMan, you should be very selective in removing tmutil exclusions as macOS and installed apps have already marked many hundreds files and folders with exclusions. You need to review the list and just remove the few that you added.

Edits:

Re-reading ALL of the first post, I realise the @BijouMan is well aware of the size of the tmutil exclusion list. I don't think there is a way to distinguish between the ones you have added and those added by macOS. :(

Moral of the tale is that we (I do it too) should not use tmutil addexclusion without keeping a list of all the files and folders we have added. Or to only use the TM GUI to add exclusions.

To assist in picking out your exclusions get a sorted list with:
sudo mdfind "com_apple_backup_excludeItem = 'com.apple.backupd'" | sort -o tm.txt
 
Last edited:
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.