Exclude Files/Folders from Backup (Time Machine & CrashPlan)

Another tiny macro:

What

It excludes files/folders from Time Machine Backup

How to

  1. Select one or more items in the Finder
  2. Run the macro
  • The selected items will be excluded from the Time Machine backup

Why

You can also exclude items via System Preferences > Time Machine > Options…, but if you just want to exclude temporary huge files (videos, graphics, etc.) this method is more convenient.

Notes

  • The command attaches the com.apple.metadata:com_apple_backup_excludeItem: com.apple.backupd Extended Attribute to the file. That is, you can move the item around without loosing the no-backup property.

  • CrashPlan also respects that Extended Attribute

Backup: Exclude.kmmacros (2.2 KB)


Not to forget, if you want to re-include an item for backup, use this macro;

Backup: Include.kmmacros (2.2 KB)


Oh, yes, and not to forget also:

Once you have entirely lost track :wink: of which files are excluded from backup, and which not, this macro comes to help:

Just run the macro and it will…

  • Create a folder “Items Excluded from Backup” on your Desktop
  • It will populate that folder with symlinks to all files that are excluded from backup (i.e. that have the ‘com_apple_backup_excludeItem’ Extended Attribute)
  • The symlinks will be named with the path of the item, so it’s easy to see where the files are located. You can also right-click the symlink (Show Original) to get to file.

Caution

The macro will delete any existing folder named “Items Excluded from Backup” on the Desktop. So if you have an important folder with that name, please modify the script before running it.

Backup: List All Excluded Files.kmmacros (2.8 KB)

Note

The macro will take a while (maybe 20s or more) to complete, since it searches the whole disk (via Spotlight).

2 Likes