瀏覽代碼

docs: add an example for --pattern usage, fixes #3661

(cherry picked from commit cf72c9592ccc0ee463f408730eadfed9f5060e96)
Thomas Waldmann 7 年之前
父節點
當前提交
bdc58c00ed
共有 1 個文件被更改,包括 10 次插入1 次删除
  1. 10 1
      src/borg/archiver.py

+ 10 - 1
src/borg/archiver.py

@@ -2075,7 +2075,16 @@ class Archiver:
             considered first (in the order of appearance). Then patterns from ``--patterns-from``
             considered first (in the order of appearance). Then patterns from ``--patterns-from``
             are added. Exclusion patterns from ``--exclude-from`` files are appended last.
             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:
                 # "sh:" pattern style is the default, so the following line is not needed:
                 P sh
                 P sh