borg-patterns(1) borg backup tool borg-patterns(1) (NAME) borg-patterns - (DESCRIPTION) (recursion root) . () borg . : o ('/') '.' '..' . o /home/user home/user . o ./src src . o ../../src src . o slashdot /this/gets/stripped/./this/gets/archived this/gets/stripped/this/gets/archived . () ('/') . ( some/path/) . ( some/path) . . ':' ( fm:path/* sh:path/**). --exclude --pattern . Fnmatch , fm: --exclude --exclude-from . (shell) '*' '?' '[...]' '[!...]' . ( '/' ) . ( [?] ?). . . '*' . . (Shell-style patterns), sh: --pattern --patterns-from . fnmatch . **/ * . . (Regular expressions), re: (Perl) . . ('^') ('$') (anchor) . ( '/' ) ('/') . re . (Path prefix), pp: . pp:root/somedir root/somedir . . (Path full-match), pf: () . . pf:root/file.ext root/file.ext . . : (hashtable) O(1) ( ). . ( ). / . . : re: sh: fm: SRE . . re: . sh: fm: (wildcard) . --exclude . () . (space) . : bash "item name" : --pattern='-path/item name' ( --exclude-from --patterns-from) . --exclude-from . ('#') . . . borg create --list --dry-run ... . : # steamapps/common ( ): $ borg create -e 'sh:**/steamapps/common/**' backup / # /home/user/.cache: $ borg create -e 'sh:home/user/.cache/**' backup /home/user $ borg create -e home/user/.cache/ backup /home/user # /home/user/.cache/important : $ borg create -e home/user/.cache/ backup / /home/user/.cache/important # /home/user/file.o /home/user/file.odt: $ borg create -e '*.o' backup / # junk home/user : $ borg create -e 'home/*/junk' backup / # home tmp. : $ borg create --exclude 're:^home/[^/]+\.tmp/' backup / # $ cat >exclude.txt < home/*/junk *.tmp fm:aa:something/* re:^home/[^/]+\.tmp/ sh:home/*/.thumbnails # some file with spaces.txt EOF $ borg create --exclude-from exclude.txt backup / --pattern --patterns-from . . R R ( ). . P ( ) P (fm pf pp re sh) . . . - - . --exclude . ! ! . . + + . . : --pattern --patterns-from + - . --exclude --exclude-from . . . : # R / # iso - **/*.iso # etc root + etc/** + root/** # - home/*/.cache # /home + home/** # ! re:^(dev|proc|run|sys|tmp) # # . - ** : . . --pattern --patterns-from (sh:) include/exclude rsync . P . (--pattern) (--exclude) ( ). --patterns-from . --exclude-from . : # : # : = . borg create --pattern=+pics/2018/good --pattern=-pics/2018 repo::arch pics # : borg create --patterns-from patterns.lst repo::arch patterns.lst : # "sh:" : P sh R / # - home/*/.cache # - home/*/Downloads # # + home/susan # + pf:home/bobby/specialfile.txt # - home/* # proc/ ! proc : # borg create --exclude home/bobby/junk repo::arch /home/bobby /home/susan borg create --patterns-from patternfile.lst repo::arch : # excludes fm: sh: . # fm: . P fm R /home/bobby R /home/susan - home/bobby/junk . (AUTHOR) The Borg Collective 2026-07-18 borg-patterns(1)