Merge pull request #21797 from MichaelEischer/always-include-explicit-targets

backup: prevent exclude of backup targets
This commit is contained in:
Michael Eischer
2026-05-31 15:42:26 +02:00
committed by GitHub
7 changed files with 224 additions and 70 deletions
+14
View File
@@ -0,0 +1,14 @@
Change: Prevent excluding paths explicitly passed to `backup`
When `restic backup --exclude-if-present .git /home/user/data` was run and
`/home/user/.git` existed, restic excluded the `data` directory from the
snapshot. The same applied to `--exclude-caches` or `--one-file-system`. Similarly,
`restic backup --exclude-larger-than 1M large-file.bin` produced an empty
snapshot when the file was larger than one megabyte.
The `backup` command now tracks which files and directories were specified on
the command line and does not apply excludes to those paths. Content inside a
backed-up directory is still filtered by excludes as before.
https://github.com/restic/restic/issues/5767
https://github.com/restic/restic/pull/21797