Skip to content

Exclusions

TechieGuy12 edited this page Aug 4, 2022 · 1 revision

Exclusions provide a way to exclude files and folders from being processed when the checksum of files are computed.

If you have files that change frequently in a directory, which would cause future checksum verifications to log those files. You can add the files to the exclusions to prevent the checksum for those file from being generated and used for verification.

Structure

<?xml version="1.0" encoding="UTF-8"?>
<settings>
    <exclusions>
        <files>
            <name></name>
        </files>
        <folders>
            <name></name>
        </folders>
        <attributes>
            <attribute></attribute>
        </attributes>
        <paths>
            <path></path>
        </paths>
    </exclusions>
</settings>

Types of Exclusions

There are different types of exclusions that can be specified within the <exclusions> element. These include the following:

Exclusion Description
files File patterns for the filter. For more information, see Patterns.
folders Folder patterns for the filter. For more information, see Patterns.
attributes File or folder attributes to exclude.
paths Paths relative to the watch path to exclude.

Each of the above exclusions represent a child element of the <exclusions> element for a watch. All of the elements can contain a list of what to exclude, so for example, multiple files names can be specified under the <files> element, or multiple attributes can be specified under the <attributes> element.

Any number of exclusions can be used, so you can exclude based on both file names and attributes, or attributes and paths, or even specify exclusions for each outlined above. When specifying multiple exclusions, the file or folder is checked against any of the exclusions, and if it matches the file or folder is excluded. The file or folder doesn't have to match all specified exclusions, it only needs to match one.

The next few sections provide more detail on each of the exclusions.

Files

The files exclusions uses the <files> element and contains a list of file names specified with a <name> child element. Any file names that match those specified here, regardless of their path, will be excluded from having the checksum computed.

Folders

Folders can be excluded by specifying each folder under the <folders> element. Much like the files exclusions, the <name> child element is used to specify the folder name. Any path that includes the folder name will be excluded, so a child folder will be excluded if a parent folder is in the folder exclusion list.

Attributes

To exclude a file or folder based on its attributes, the <attributes> element can be used. This element will contain a list of one or more <attribute> child elements that specify an attribute to exclude. The attribute values include the following:

Attribute Description
Archive The file or folder is marked as archive.
Compressed The file or folder is compressed.
Encrypted The file or folder is encrypted.
Hidden The file or folder is hidden.
ReadOnly The file or folder is read only.
System The file or folder is marked as system.

Note: The above attributes are case-sensitive, so they will need to be added to the configuration file as shown above.

Paths

If a specific file or folder needs to be excluded, and the file or folder exclusion lists are too broad, you can specify a relative path to the file or folder using the <paths> element. You can specify multiple <path> child elements - one for each path - that you would to exclude.

Examples

Exclude a file named doc1.doc:

<settings>
    <exclusions>
        <files>
            <name>doc1.doc</name>
        </files>
    </exclusions>
</settings>

Exclude a folder named Documents:

<settings>
    <exclusions>
        <folders>
            <name>Documents</name>
        </folders>
    </exclusions>
</settings>

Exclude a file or folder with the System attribute:

<settings>
    <exclusions>
        <attributes>
            <attribute>System</attribute>
        </attributes>
    </exclusions>
</settings>

Exclude the file C:\Temp\Documents\doc1.doc:

<settings>
    <exclusions>
        <paths>
            <path>C:\Temp\Documents\doc1.doc</path>
        </paths>
    </exclusions>
</settings>

Exclude files named doc1.doc or folders named Documents:

<settings>
    <exclusions>
        <files>
            <name>doc1.doc</name>
        </files>
        <folders>
            <name>Documents</name>
        </folders>
    </exclusions>
</settings>
Clone this wiki locally