Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

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

enter image description here

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.

share|improve this question

4 Answers 4

up vote 30 down vote accepted

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 from my system (10.7.1) 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.db

As you can see, there are a few files here which various apps have told Time Machine not to bother with. 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.
share|improve this answer
3  
That mdfind query is gold - thanks! –  bmike Sep 23 '11 at 22:14
    
I would love to upvote you multiple times for this answer :-) –  Heiko Rupp Nov 23 '12 at 14:18
    
Yeah seriously, if I could offer a 200-point retroactive bounty, I would. Awesome answer. –  orange80 Jun 15 at 3:49

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.

share|improve this answer
    
~/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/. –  ؘؘؘؘ Oct 22 '12 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 TM to ignore certain files.

share|improve this answer
1  
Dustin, 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 Sep 29 '11 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.plist

My latest snapshot included the folders in StdExclusions.plist and the folders excluded in Time Machine's preferences. It didn't include files or folders that just had the com.apple.metadata:com_apple_backup_excludeItem extended attribute.

share|improve this answer
    
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. –  bmike Oct 22 '12 at 16:42

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.