- Print
- DarkLight
Configure Custom Exclusions using XML (Mac)
- Print
- DarkLight
Exclusions prevent all files and subfolders of a directory from being indexed or included in a Backblaze backup.
Changes were made to the Backblaze Computer Backup Mac client in version 4.1 and newer that make it easier to determine what is excluded and to set custom exclusions other than the standard folder, file size, or file type options.
In the new system, some exclusions are mandatory, including operating system files and program files. These exclusions are in the file named bzexcluderules_mandatory.xml located here: /Library/Backblaze.bzpkg/bzdata
.
You can view this file with a text editor, and it contains the permanent exclusion that Backblaze uses.
Exclusion Rules
You can edit the file bzexcluderules_editable.xml to create more robust rules to exclude data. To restore the defaults, you can remove the file. It returns when you perform your next backup.
The Support team does not troubleshoot the edits that are in this file, and they do not create rules.
If you contact the Support team regarding the editing of the bzexcluderules_editable.xml file, they will instruct you to delete the file, perform a backup, and generate the default file again.
- The
excludefname_rule
variable is case insensitive. - A file must match all of the criteria on the line to be excluded from backup.
- An
excludefname_rule
variable must specify all criteria. Use "*" to skip criteria. - The
skipFirstCharThenStartsWith
variable is "*" or must be at least four characters long. - All of the rules apply to all attached volumes. This means that all rules are applied to
/
and also/Volumes/externalUsbDrive/
and/Volumes/movies/
, etc.
Valid Operating System Versions (osVers
)
- 10.9
- 10.10
- 10.11
- 10.12
- 10.13
- 10.14
- 10.15
hasFileExtensiom
versus endsWith
: A "file extension" in this context is strictly defined as the last period followed by non-space, simple ASCII characters, and it does not contain a forward slash (/) or backslash (\). The endsWith
is more general in that it can have spaces and include either slash. The hasFileExtension
is faster and helps the code group the same file extensions together, so you should specify the hasFileExtension
, if possible.
Performance Hints
Always specify a skipFirstCharThenStartsWith
. It is very performant and assists with pruning 99% of files from undergoing additional criteria checks.
Internally, the code groups together many tests with identical startsWith
and skipFirstCharThenStartsWith
, so those comparisons are done only once (not once for each excludefname_rule
).
Next, you should specify hasFileExtension
if possible, or if not, then define endsWith
which results in faster performance than contains_1
and contains_2
.