mirror of
https://github.com/octoleo/restic.git
synced 2024-12-23 11:28:54 +00:00
32 lines
799 B
Plaintext
32 lines
799 B
Plaintext
|
Enhancement: Add negative patterns for include/exclude
|
||
|
|
||
|
If a pattern is suffixed by an exclamation mark and match a file that
|
||
|
was previously matched by a regular pattern, the match is cancelled.
|
||
|
Notably, this can be used with `--exclude-file` to cancel the
|
||
|
exclusion of some files.
|
||
|
|
||
|
It works similarly to `gitignore`, with the same limitation: once a
|
||
|
directory is excluded, it is not possible to include files inside the
|
||
|
directory.
|
||
|
|
||
|
Example of use (as an exclude pattern for backup):
|
||
|
|
||
|
$HOME/**/*
|
||
|
!$HOME/Documents
|
||
|
!$HOME/code
|
||
|
!$HOME/.emacs.d
|
||
|
!$HOME/games
|
||
|
# [...]
|
||
|
node_modules
|
||
|
*~
|
||
|
*.o
|
||
|
*.lo
|
||
|
*.pyc
|
||
|
# [...]
|
||
|
$HOME/code/linux/*
|
||
|
!$HOME/code/linux/.git
|
||
|
# [...]
|
||
|
|
||
|
https://github.com/restic/restic/issues/233
|
||
|
https://github.com/restic/restic/pull/2311
|