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: a pattern that matches no
rule removes nothing. From version 1.0.6 Nyx Backup reports such an entry (see
“Checking your files” below); earlier versions ignored it silently. 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.
Switching an optional category back on
Some built-in categories are marked OPTIONAL in their description. They are left out by default because they are very large or can be downloaded again, but they are not junk, and you may want them:
| Category | Windows | macOS | Linux |
|---|---|---|---|
vm_disk_images - virtual-machine disks | yes | yes | yes |
installed_games - installed Steam games (steamapps/common) | yes | yes | yes |
ios_device_backups - iPhone and iPad backups | yes | ||
xcode_archives - Xcode release archives | yes | ||
disk_image_bundles - .sparsebundle disk images | yes | ||
installed_apps - installed Flatpak apps and snap packages | yes | ||
container_volumes - Docker and Podman named volumes | yes |
To back one up, list every pattern of that category in [unexclude], copied
from the shipped file. For example, to include iPhone and iPad backups on a
Mac:
# /Library/Application Support/NyxBackup/exclusions.d/my-rules.toml
[unexclude]
patterns = [
'^/Users/[^/]+/Library/Application Support/MobileSync/Backup(/.*)?$',
]
Applying changes
From version 1.0.6 there is nothing to do: the service reads your drop-in files again at the start of every backup, so a change applies to the next run.
Versions before 1.0.6 read them only when the service starts. On those, restart it after editing a drop-in:
# Linux
sudo systemctl restart nyx-backup
# macOS
sudo launchctl kickstart -k system/com.nyxbackup.app
# Windows (elevated)
net stop NyxBackupSvc && net start NyxBackupSvc
Checking your files
From version 1.0.6, Settings > Advanced > Personal exclusions lists every
file in the drop-in folder with its result: how many rules it adds and how
many built-in rules it switches off, or exactly what needs fixing - a TOML
mistake with its position, a missing field, a pattern that is not a valid
regular expression, a category written for another operating system, or an
[unexclude] entry that matches no rule. Whatever is listed as needing a fix
does not apply, and Check again re-reads the folder after you fix it. On a server,
nyx_bkp_cli exclusions-check prints the same report.
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.