Exclude files and folders globally using exp: in snowagent.config
Snowagent provides flexible options for excluding files and folders during inventory scans. The exp: expression rule enables you to apply exclusions regardless of their location on the machine by leveraging wildcards. This article shows how to configure these exclusions on Windows and case-sensitive operating systems like Linux and macOS.
Understanding exp: expression
The exp: prefix provides pattern-based exclusions. By using wildcards (*), file and folder names are excluded from scans regardless of their directory path.
Examples for Windows Systems
Windows uses backslashes (\) for paths.
- Exclude any folder named “razer” anywhere on the machine:
<Path>exp:*\razer\*</Path> - Exclude any file named “razer” anywhere on the machine:
<Path>exp:*\razer*</Path>
Examples for Linux and macOS Systems
Linux and macOS use forward slashes (/) and are case-sensitive. Use:
- Exclude any folder named “razer” anywhere on the machine:
<Path>exp:*/razer/*</Path> - Exclude any file named “razer” anywhere on the machine:
<Path>exp:*/razer*</Path>
On case-sensitive operating systems such as Linux or macOS, file and folder names like “razer” and “Razer” are considered distinct. Specifying exp:/razer excludes lowercase matches but does not exclude uppercase matches.
You can use a wildcard for the first character to capture case variations, but this may exclude more files than intended:
<Path>exp:*/ *azer*</Path>
Instead, you can add two lines for both variants.
For folders:
<Path>exp:*/razer/*</Path>
<Path>exp:*/Razer/*</Path>
For files:
<Path>exp:*/razer*</Path>
<Path>exp:*/Razer*</Path>
Why use exp: instead of absolute paths?
Absolute paths (such as C:\Program Files\razer\* or /usr/local/razer/*) only exclude items in the specified directory. If the same file or folder exists elsewhere, it will not be excluded. The exp: rule applies globally, ensuring comprehensive exclusions.
Best Practices
- Test exclusions in a controlled environment before wide deployment.
- Use specific patterns to avoid unnecessary exclusions.
- Document all exclusion rules for audits and troubleshooting.
The inventory scan excludes defined files and folders globally based on your pattern configuration.