Skip to main content

This article applies to version 6.

Other available versions:

Version 5 | Version 4icon.qnmark.png

Available in:

StandardPremiumEnterprise
Small Business
Code42 Support

Code42 app and Mac metadata

This article applies to version 6.

Other available versions:

Version 5 | Version 4icon.qnmark.png

Available in:

StandardPremiumEnterprise
Small Business

Overview

This article explores how the Code42 app and the Mac OS use metadata to determine which files to exclude from your backup.

What is metadata?

Metadata is data about data. A good example of metadata is the file creation date. When saving a file on your hard drive, your computer automatically records information about when the file was created. You don't manually say, “I created this on 3/19/99 at 12:00pm.” Your computer does it for you.

Calendar cache example

The Calendar application on Macintosh systems is a great example of how metadata works with Code42 app backups. If you have included your Calendar folder in your backup selection, then any changes to that folder, such as adding or removing calendar entries, are automatically backed up to the Code42 app.

What about cache?

The Calendar cache file is a convenience to make the Calendar entries load more quickly, and it changes every time you add, remove, or edit a calendar entry. However, it doesn't contain your actual calendar entries; those are maintained in other files. And if you delete the cache, a new cache file is started automatically. Basically, it's a complete waste of time to back up.

That's where metadata comes in. To avoid unnecessary backups, the Calendar application attaches metadata to the Calendar cache file that says, “Don't back this up.” The Code42 app is smart enough to note the request and ignore the file.

Any program on Mac OS can tag any file with the “Don't back this up” metadata. Generally, programs like Calendar know best when it comes to identifying which files should be backed up and which ones shouldn't. However, there may be times when you want to override the existing metadata in order to include a file for back up that is excluded by default. Read on to learn how.

What is being excluded?

Finding out what is being excluded from your backup based on metadata is easy, but requires interaction with the Mac command line. To find out which files are being excluded on your system, enter the following line in Terminal:
sudo mdfind "com_apple_backup_excludeItem = 'com.apple.backupd'"

This command queries Spotlight to tell you every file that has the metadata “com_apple_backup_excludeItem”, which means, “Don't back this up.”

Remove exclusion metadata

To remove exclusion metadata from a file on Mac, open Terminal and enter the following command, replacing "<file path>" with the full path to your desired file (for example, "/Users/Joseph/my file.iso").
sudo tmutil removeexclusion "<file path>"

To confirm that exclusion metadata has been removed, enter the following command:
sudo mdfind "com_apple_backup_excludeItem = 'com.apple.backupd'"

If the above removal command succeeded, the name of your file is not included in the list of excluded items.

Example

For this example, let's assume you see a file named windows image.vmdk in the list of metadata backup exclusions, and that you do actually want to make sure that file is backed up by the Code42 app. To change the metadata on the file and enable back up, enter the following in Terminal:
sudo tmutil removeexclusion "/Users/Joseph/windows image.vmdk"

To confirm that the file has been removed from the excluded item list, you can enter the following in Terminal:
sudo mdfind "com_apple_backup_excludeItem = 'com.apple.backupd'"

This command lists all excluded items. Because the file you removed, windows image.vmdk, is not listed, it will be backed up.

Now the Code42 app knows to back up the windows image.vmdk file. In fact, other backup software also note that change, so if you happen to also be using Time Machine, Time Machine would start backing up the file as well.

Considerations for removing exclusion metadata

It is wise to make sure your critical files are not marked with metadata that says, “Don't back this up,” but it's also important to use caution when changing metadata on files. Most of the time, metadata to exclude files from backup is there for a reason (the files may be unnecessary, temporary in nature, or large system files that don't back up well).

Make sure you understand the implications of changing the backup metadata not only for the
Code42 app, but for any other software that depends on metadata.

Exclude files from backup

Adding metadata to stop files from being backing up isn't necessary. If you no longer wish to back up a file, simply remove it from your backup file selection or create an exclusion filter.