From cf72c9592ccc0ee463f408730eadfed9f5060e96 Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Fri, 9 Mar 2018 21:37:06 +0100 Subject: [PATCH] docs: add an example for --pattern usage, fixes #3661 --- src/borg/archiver.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/borg/archiver.py b/src/borg/archiver.py index 0f8b27c91..f57780aee 100644 --- a/src/borg/archiver.py +++ b/src/borg/archiver.py @@ -1923,7 +1923,16 @@ class Archiver: considered first (in the order of appearance). Then patterns from ``--patterns-from`` are added. Exclusion patterns from ``--exclude-from`` files are appended last. - An example ``--patterns-from`` file could look like that:: + Examples:: + + # backup pics, but not the ones from 2018, except the good ones: + # note: using = is essential to avoid cmdline argument parsing issues. + borg create --pattern=+pics/2018/good --pattern=-pics/2018 repo::arch pics + + # use a file with patterns: + borg create --patterns-from patterns.lst repo::arch + + The patterns.lst file could look like that:: # "sh:" pattern style is the default, so the following line is not needed: P sh