mirror of
https://github.com/restic/restic.git
synced 2026-09-03 11:17:14 +00:00
backup: prevent exclude of backup targets
Track backup targets explicitly specified by the user and prevent excluding them. This for example ensures that `restic backup --exclude-if-present .git /home/user/data` backs up the `data` folder even if there is a `.git` folder in `/home/user`. Note that this does not suffice for commands like `restic backup --exclude data /home/user/data` as the exclude pattern will still match every single file within `data`.
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user