Excluding files and folders from a backup task

This article is for an older version of CCC. You can find the latest version here.
Product: 
ccc3

CCC conveniently lists the contents of your source volume when you select it in the Source menu. Next to each item in this list of "Items to be copied", there is a checkbox that, when unchecked, indicates that an item should not be copied to your destination volume (unchecked items will also turn red to indicate that they are excluded). Each folder in this table has a disclosure triangle, just like in the Finder. Click on the disclosure triangle to reveal the contents of a folder, then you can continue deselecting items to be copied, if desired. CCC will not allow you to navigate beyond the folders for which you have permission to view. Additionally, if you deselect an item that is required for OS X to boot, CCC will note this as a "Configuration concern" when you click the Clone button. Your destination volume will be bootable as long as it meets the requirements for OS X and you select to copy all required system files.

Configuring items to be copied

The popup menu next to the Source menu (the one with a gear icon) is a contextual filters menu. That menu is enabled when you have selected a local volume or disk image in the source menu. Filters allow you to specify which items on your source should not be copied to the destination. A filter is updated automatically for you when you uncheck items in the "Items to be copied" table. More advanced filtering options are available as well, including the ability to exclude items based on file type and the ability to specify your own rsync-compatible rules.

Creating filters

Creating your own filters is a breeze. Simply choose a source volume in the Source popup menu, then start deselecting items that you do not want to copy. As you deselect items, the default filter for that volume is updated with your selections. To view and edit the filters that you have created, click on the "gear" popup menu next to the Source Disk popup menu. [If this button is disabled, select a source volume from the Source popup menu.]

Configuring Filters

In the Filter Settings window, you see a list of filters on the left and the contents of those filters on the right. Every time you choose a volume from the Source popup menu, a filter is created for you with a name in the form of "Macintosh HD (Default)". As you deselect items to be copied, those items are added to the filter. When you quit CCC, the filters are saved and available the next time you launch CCC. Whenever you choose a volume in the Source popup menu in the future, the settings from the default filter for that volume will be applied.

Customizing filters

Typically you will not need to manually configure your filters. If you would like to maintain more than one filter for a particular volume, or if you would like to apply more advanced settings such as file type filters, then you do so in the Filter Settings window. To create a new filter, click the "+" button and provide a name for the filter. To remove a filter, select the filter in the Filters table and click on the "-" button. If you delete a default filter for a volume, that filter will be recreated the next time you select that volume in the Source popup menu.

To delete items from a filter, select the item(s) from the "Items you have excluded..." table on the right and click the "-" button or press the delete key.

Advanced filter options

If the files you want to exclude are scattered across your filesystem, it may be tedious to manually exclude each of them. To address this, CCC implements file type filters. File type filters allow you to specify a file extension (e.g. "dmg", "doc", "mp3", etc.) of a file type that you would like to exclude. Suppose you want to exclude disk images from being backed up, for example, simply add "dmg" to the File types filter table and any file with that extension will be excluded.

For the truly adventurous, CCC permits the definition of custom rules. These custom rules follow the syntax defined in the "INCLUDE/EXCLUDE PATTERN RULES" section of the rsync man page. Using the rules in the screenshot above as an example:

- Library/Caches
- /private/var/log
- /Library/Logs

The "No logs or cache" filter will exclude any item that contains "Library/Caches" *anywhere* in the path (for example, ~/Library/Caches in every users home directory as well as in /Library/Caches). Items in the /private/var/log folder at the root of the volume will be excluded as well as items in /Library/Logs (but not, for example, in /Users/mike/Library/Logs). Note that in the case of /private/var/log, you must indicate the real path of the folder to be excluded. Indicating the /var/log symbolic link, for example, would not be sufficient to exclude the contents of this folder.

You can learn more about custom rules by reading the "EXCLUDE PATTERNS" section of the rsync man page.

Note: Filters specified in the "Advanced options" section of the Filter Settings window will not be reflected in the "Items to be copied" table in the main window.

Items automatically ignored

Carbon Copy Cloner excludes some items from the backup task by default. A complete list of exclusions along with an explanation for the exclusion is available in this section of the documentation.

The CCC temporary archive folder, "_CCC Archives" is excluded by a global filter. See the Managing previous versions of your files section of the documentation to learn how to restore items from that folder.

Additionally, CCC will exclude and protect system folders if you select the startup disk as the destination (these items will be grayed out in the "Items to be copied" table). If you would like to restore a specific item, such as the contents of /Library/Application Support, this protection can be avoided by choosing a specific folder at the source and destination via the "Choose a folder" options in the Source and Destination menus. With great power comes great responsibility — take care to avoid overwriting your system files.

CCC includes everything by default, items must be explicitly excluded

When you deselect an item from the list of items to be copied, CCC adds this item to a list of excluded items. By default, though, everything on your source volume or folder will be included in the backup task. This was a design choice that we specifically chose after long discussions with beta testers. We decided that we couldn't reliably predict what the end user might want to do with new files and folders added since a backup task was created, so we took the conservative option of assuming that anything new should be backed up. Consider the following scenario to understand the implications of this design choice:

You instruct CCC to back up the contents of a "Fruits" folder to a "Fruits" folder on the destination volume on a regular basis. When you created the backup task, the source folder contained:

  • Apples
  • Grapes
  • Lemons
  • Oranges
  • Pears

Suppose you only want non-citrus fruits backed up, though, so you exclude Lemons and Oranges from the backup task. After running the backup task, there are three items in the Fruits folder on the destination: Apples, Grapes, and Pears.

At some time in the future, you add "Watermelons", "Peaches", and "Pineapple" to the Fruits folder on the source volume. Because these items are not explicitly excluded, and because CCC only excludes items from the backup task that are explicitly excluded, these new items will appear in the Fruits folder on your destination volume the next time your scheduled task runs.

Forcing CCC to exclude everything by default and include specific items

Using custom filter rules as documented above, you can configure CCC to back up only specific items within a folder and to exclude anything else by default. The following rules would configure CCC to back up only the Apples, Grapes, and Pears folders and exclude everything else by default, including new items added to the source folder:

+ /Apples/
+ /Grapes/
+ /Pears/
- /*

The last rule explicitly excludes everything, so only the items explicitly included will be backed up.

Note: The effects of custom rules are not reflected in the list of items to be copied. When applying rules like this, it is best to not make changes to the list of items to be copied to avoid confusion about what will and will not be excluded from the backup task. Both sets of exclusions will apply, though custom rules (includes and excludes) take precedence over exclusions defined in the list of items to be copied.