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.
Best Answer
There's 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 copy StdExclusions.plist (10.7.1) on Pastebin. There also is StdExclusions.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:
On my system this outputs the following:
As 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 the extended attribute
com.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.