-
-
Notifications
You must be signed in to change notification settings - Fork 837
Description
Sometimes the ability to not only exclude patterns but also explicitly specify includes can be useful.
I propose a new optional pattern prefix '+' that may be used with --exclude or in --exclude-from files to define include-patterns. (Just like include/exclude pattern rules in rsync.)
These patterns may be used to explicitly include files in a backup that would otherwise be excluded by a following pattern.
Some use cases:
-
exclude docs but backup pdfs:
--exclude +/data/docs/pdf --exclude /data/docs/(maybe
--include /data/docs/pdfshould be introduced to improve readability.) -
use a common exclude list deployed to all backup clients but override it on some specific client:
global.inclexcl:/tmp *.tmp /scratchlocal.inclexcl:+/scratch /home/dir_to_exclude$ borg create --exclude-from local.inclexcl --exclude-from global.inclexl backup /equivalent:
global.inclexcl:-sh:/tmp -fm:*.tmp -fm:/scratchlocal.inclexcl:+fm:/scratch -/home/dir_to_exclude
(Actually the same approach is already used by the --keep-tag-files option.)