In addition to whatever files I may choose to exclude, what files does the system exclude by rule or classification?

It might make sense not to backup Trash or Caches, but I'm looking for a way to tell what files are skipped "behind the scenes." Knowing if the system maintains an exclusion list or exclusion pattern would be very helpful in managing larger groups of macs.
5 Answers5
In earlier versions of macOS (pre-11.x) there was a built-in list of exclusions stored in/System/Library/CoreServices/backupd.bundle/Contents/Resources/StdExclusions.plist. It's a bit too long to paste here comfortably, so I've posted a copyStdExclusions.plist (10.7.1) on Pastebin. There also isStdExclusions.plist (10.6.8 Server) on Pastebin.
Some of the more obvious user file exclusions are Trash, Document revisions and MobileBackups from the local Time Machine store are all excluded. The rest of the exclusions are for system things like caches and databases that exist to index other files where the system can regenerate these databases after a restore.
In addition, apps can use a file's metadata to exclude a file from backups. You can view this list of files by running the command:
sudo mdfind "com_apple_backup_excludeItem = 'com.apple.backupd'"On my system this outputs the following:
/Users/brant/Library/Calendars/Calendar Cache/Users/brant/Music/iTunes/iTunes Music Library.xml/Users/brant/Library/iTunes/iPod Software Updates/Users/brant/Library/iTunes/iPad Software Updates/Users/brant/Library/iTunes/iPhone Software Updates/Users/brant/Pictures/iPod Photo Cache/Volumes/Archive/brant/Pictures/iPhoto Library/iPod Photo Cache/Volumes/Archive/brant/Pictures/iPhoto Library/AlbumData.xml/Users/brant/Library/Application Support/Google/Chrome/Safe Browsing Csd Whitelist/Users/brant/Library/Application Support/Google/Chrome/Safe Browsing Bloom/Users/brant/Library/Application Support/Google/Chrome/Safe Browsing Bloom Filter 2/Users/brant/Library/Application Support/Google/Chrome/Safe Browsing Download/Users/brant/Documents/Virtual Machines/Visual Studio.pvm/{ae6f7518-762e-4fcd-b166-c7a914fc237f}.mem/Users/brant/Music/iTunes/Album Artwork/Cache/Users/brant/Library/Saved Application State/Users/brant/Library/Application Support/Google/Chrome/Default/History-journal/Users/brant/Library/Application Support/Google/Chrome/Default/Favicons-journal/Users/brant/Library/Application Support/Google/Chrome/Default/Favicons/Users/brant/Library/Application Support/Google/Chrome/Default/History/Users/brant/Library/Icons/WebpageIcons.db/Users/brant/Library/Safari/WebpageIcons.dbAs you can see, there are a few files here which various apps have told Time Machine not to bother with. Internally, this works by changing theextended attributecom.apple.metadata:com_apple_backup_excludeItem.
Furthermore, on Lion, the tmutil command allows you to query, set, and delete file exclusions from the command line:
tmutil isexcluded _item_will determine if the volume, directory or file is currently excluded.tmutil addexclusion _item_sets an exclusion rule so that the item (even if moved to a new location or renamed) will be excluded from future backups.tmutil addexclusion -p _item_sets an exclusion rule so that the item path is excluded. This remains unchanged so if the file moves it will be backed up if not at this exact path and also will prevent backing up a file if it comes back in the same location as the rule specifies.tmutil removeexclusion _item_removed either type of exclusion rule as appropriate.
- 1I would love to upvote you multiple times for this answer :-)Heiko Rupp– Heiko Rupp2012-11-23 14:18:55 +00:00CommentedNov 23, 2012 at 14:18
- 1Yeah seriously, if I could offer a 200-point retroactive bounty, I would. Awesome answer.orange80– orange802014-06-15 03:49:27 +00:00CommentedJun 15, 2014 at 3:49
- 1On my system,
mdfindoutputs alot more -- including~/Applications and~/Library/Screen Savers. Be careful!SilverWolf– SilverWolf2018-06-25 13:20:43 +00:00CommentedJun 25, 2018 at 13:20 - 1In 2022 with Big Sur 11.6.2, that file does not appeat to exist:
ls /System/Library/CoreBigServices/backupd.bundle/Contents/Resources/StdExclusions.plist ls: /System/Library/CoreServices/backupd.bundle/Contents/Resources/StdExclusions.plist: No such file or directoryDave X– Dave X2022-03-02 14:30:15 +00:00CommentedMar 2, 2022 at 14:30 - 1Starting with Big Sur, it seems that this is the only reliable method for looking up what the standard exclusions are:apple.stackexchange.com/a/440605/311642rs2ts– 2rs2ts2022-10-16 23:13:27 +00:00CommentedOct 16, 2022 at 23:13
By default, Apple Time Machine does not back up:
- System log files
- Spotlight indexes
- Cache files of any type
- Files in the Trash (or any other user's Trash)
- Temporary files
- Specific application data that an app may flag for Time Machine to not back up
This applies to all versions of Mac OS X which have Time Machine.
Source: Kevin M. White.Apple Training Series: Mac OS X Support Essentials v10.6. Peachpit Press.
- ~/Library/Caches/ and ~/Library/Logs/ are excluded from backups, but they still include some cache and log files in folders like /var/db/ and /var/log/.Lri– Lri2012-10-22 12:34:45 +00:00CommentedOct 22, 2012 at 12:34
You'll probably find this useful -http://hints.macworld.com/article.php?story=20080328025026826
Specifically:
sudo mdfind "com_apple_backup_excludeItem = 'com.apple.backupd'"Will return what is being ignored. Apps can tell TimeMachine to ignore certain files.
- 2Dustin, answers that are no more than links are not good answers. When a link answers the question, it is important not only to cite the source, but to quote relevant details. Sites go down, urls change, etc.Jason Salaz– Jason Salaz2011-09-29 17:13:33 +00:00CommentedSep 29, 2011 at 17:13
The root folders of snapshots also have a property list with folders that were excluded from the snapshot.
sudo defaults read /Volumes/Time\ Machine/Backups.backupdb/*/Latest/.exclusions.plistMy latest snapshot included the folders inStdExclusions.plist and the folders excluded in Time Machine's preferences. It didn't include files or folders that just had thecom.apple.metadata:com_apple_backup_excludeItem extended attribute.
- Wow - I better poke at this a bit. Mountain Lion has changed how exclusions are handled when you add them back to the backup set. No longer are folders incrementally backed in this case, instead a full backup of the files happens the next backup covering that file.2012-10-22 16:42:24 +00:00CommentedOct 22, 2012 at 16:42
- 1In recent MacOS versions this file is binary — it can be opened with xcode or converted to XML in a console with
plutil -convert xml1 .exclusions.plist(use on a copy!)ccpizza– ccpizza2021-04-04 21:12:17 +00:00CommentedApr 4, 2021 at 21:12
If you want to check for the presence of the extended attributecom.apple.metadata:com_apple_backup_excludeItem on a specific file/directory you can use thexattr command:
xattr path_to_file_nameOr themdls command (which will also show you the metadata attributes):
mdls path_to_file_nameBut the best way to check if a file/dir is excluded from backup is to usetmutil, as suggested above, since it also checks whether it is on any exclusion list:
tmutil isexcluded path_to_file_nameYou mustlog in to answer this question.
Explore related questions
See similar questions with these tags.
