Customising exclusions
Nyx Backup skips files on two independent levels.
Your own exclusions, per backup set: folders, files and patterns you choose in the desktop app while picking sources. These are part of the set and travel with it.
The built-in list, applied on top of yours: an operating-system-aware set of
things that should never be backed up - page and swap files, hibernation files,
the recycle bin, system caches, temporary directories, and Nyx Backup’s own
state and logs. You do not have to think about these, and excluding them is why
a backup of C:\ does not try to copy pagefile.sys.
Your own exclusions (the desktop app)
While selecting sources, uncheck anything inside a selected folder to exclude it. Excluded items stay listed, struck through and tagged excluded; hover the tag to see why. Click one again to put it back.
This is the only place exclusions can be created. The terminal interface shows how many a set has, on the source-paths line, but cannot change them - it is there so a set with exclusions is never mistaken for one without.
Changing the built-in list
The built-in list ships as a per-platform file:
| Platform | File |
|---|---|
| Windows | <install dir>\exclusions\windows_exclusions.toml |
| macOS | /Library/Application Support/NyxBackup/exclusions/macos_exclusions.toml |
| Linux | /etc/nyxbackup/exclusions/linux_exclusions.toml |
Do not edit those files. They are replaced on every upgrade, and your
changes will vanish without warning. Read them by all means - they are the
reference for what is excluded, and you will need their exact wording for the
[unexclude] section below.
Instead, drop your own .toml file into the exclusions.d directory beside
them:
| Platform | Drop-in directory |
|---|---|
| Windows | %ProgramData%\NyxBackup\exclusions.d\ |
| macOS | /Library/Application Support/NyxBackup/exclusions.d/ |
| Linux | /etc/nyxbackup/exclusions.d/ |
No installer writes to that directory, so upgrades leave it alone. Nyx Backup
does not create it either - make it yourself. Every *.toml file in it is
loaded. A missing directory simply means no drop-ins.
Adding exclusions
# /etc/nyxbackup/exclusions.d/my-rules.toml
[categories.my_build_artifacts]
description = "Local build output - reproducible, no need to back it up"
applies_to = ["linux"]
patterns = [
'^/home/[^/]+/src/[^/]+/target(/.*)?$',
'^/home/[^/]+/\.cargo/registry(/.*)?$',
]
Patterns are regular expressions matched against the normalised path: forward
slashes on Linux and macOS, backslashes and an uppercase drive letter on
Windows. applies_to uses the same OS tags as the shipped file - copy the ones
you see there (windows, win11, server2022, linux, macos and so on). A
category whose tags do not match the machine is skipped, exactly as in the
built-in file.
Use this for machine-wide rules that should apply to every backup set. For one set only, use the app.
Removing a built-in exclusion
If a built-in rule is excluding something you actually want, negate it rather than editing the shipped file:
[unexclude]
patterns = [
'.:\\Users\\.+\\AppData\\Local\\Temp\\.*',
]
The match is exact, against the pattern text - not against a path. Copy the
line verbatim out of the shipped *_exclusions.toml, including its escaping.
Writing the path you want restored will not work, and will fail silently
because there is nothing to report: a pattern that matches nothing removes
nothing. If a negation does not take effect, the usual cause is a copy that
differs by one character.
Negation runs last, after the built-in and drop-in patterns have been collected, so it can cancel any of them.
Applying changes
The service reads exclusions at startup. Restart it after editing a drop-in:
# Linux
sudo systemctl restart nyx-backup
# macOS
sudo launchctl kickstart -k system/com.nyxbackup.daemon
# Windows (elevated)
net stop NyxBackupSvc && net start NyxBackupSvc
Checking what is actually excluded
The desktop app’s source picker greys out anything the service will skip and gives the reason on hover, which is the quickest way to confirm a rule does what you meant. The terminal interface’s file browser shows the same, with the reason in brackets after the name.