| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144 | .\" Man page generated from reStructuredText...TH BORG-PATTERNS 1 "2017-02-11" "" "borg backup tool".SH NAMEborg-patterns \- Details regarding patterns..nr rst2man-indent-level 0..de1 rstReportMargin\\$1 \\n[an-margin]level \\n[rst2man-indent-level]level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]-\\n[rst2man-indent0]\\n[rst2man-indent1]\\n[rst2man-indent2]...de1 INDENT.\" .rstReportMargin pre:. RS \\$1. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]. nr rst2man-indent-level +1.\" .rstReportMargin post:...de UNINDENT. RE.\" indent \\n[an-margin].\" old: \\n[rst2man-indent\\n[rst2man-indent-level]].nr rst2man-indent-level -1.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]].in \\n[rst2man-indent\\n[rst2man-indent-level]]u...SH DESCRIPTION.spExclusion patterns support four separate styles, fnmatch, shell, regularexpressions and path prefixes. By default, fnmatch is used. If followedby a colon (\(aq:\(aq) the first two characters of a pattern are used as astyle selector. Explicit style selection is necessary when anon\-default style is desired or when the desired pattern starts withtwo alphanumeric characters followed by a colon (i.e. \fIaa:something/*\fP)..sp\fI\%Fnmatch\fP, selector \fIfm:\fP.INDENT 0.0.INDENT 3.5This is the default style.  These patterns use a variant of shellpattern syntax, with \(aq*\(aq matching any number of characters, \(aq?\(aqmatching any single character, \(aq[...]\(aq matching any singlecharacter specified, including ranges, and \(aq[!...]\(aq matching anycharacter not specified. For the purpose of these patterns, thepath separator (\(aq\(aq for Windows and \(aq/\(aq on other systems) is nottreated specially. Wrap meta\-characters in brackets for a literalmatch (i.e. \fI[?]\fP to match the literal character \fI?\fP). For a pathto match a pattern, it must completely match from start to end, ormust match from the start to just before a path separator. Exceptfor the root path, paths will never end in the path separator whenmatching is attempted.  Thus, if a given pattern ends in a pathseparator, a \(aq*\(aq is appended before matching is attempted..UNINDENT.UNINDENT.spShell\-style patterns, selector \fIsh:\fP.INDENT 0.0.INDENT 3.5Like fnmatch patterns these are similar to shell patterns. The differenceis that the pattern may include \fI**/\fP for matching zero or more directorylevels, \fI*\fP for matching zero or more arbitrary characters with theexception of any path separator..UNINDENT.UNINDENT.spRegular expressions, selector \fIre:\fP.INDENT 0.0.INDENT 3.5Regular expressions similar to those found in Perl are supported. Unlikeshell patterns regular expressions are not required to match the completepath and any substring match is sufficient. It is strongly recommended toanchor patterns to the start (\(aq^\(aq), to the end (\(aq$\(aq) or both. Pathseparators (\(aq\(aq for Windows and \(aq/\(aq on other systems) in paths arealways normalized to a forward slash (\(aq/\(aq) before applying a pattern. Theregular expression syntax is described in the \fI\%Python documentation forthe re module\fP\&..UNINDENT.UNINDENT.spPrefix path, selector \fIpp:\fP.INDENT 0.0.INDENT 3.5This pattern style is useful to match whole sub\-directories. The pattern\fIpp:/data/bar\fP matches \fI/data/bar\fP and everything therein..UNINDENT.UNINDENT.spExclusions can be passed via the command line option \fI\-\-exclude\fP\&. When usedfrom within a shell the patterns should be quoted to protect them fromexpansion..spThe \fI\-\-exclude\-from\fP option permits loading exclusion patterns from a textfile with one pattern per line. Lines empty or starting with the number sign(\(aq#\(aq) after removing whitespace on both ends are ignored. The optional styleselector prefix is also supported for patterns loaded from a file. Due towhitespace removal paths with whitespace at the beginning or end can only beexcluded using regular expressions..spExamples:.INDENT 0.0.INDENT 3.5.sp.nf.ft C# Exclude \(aq/home/user/file.o\(aq but not \(aq/home/user/file.odt\(aq:$ borg create \-e \(aq*.o\(aq backup /# Exclude \(aq/home/user/junk\(aq and \(aq/home/user/subdir/junk\(aq but# not \(aq/home/user/importantjunk\(aq or \(aq/etc/junk\(aq:$ borg create \-e \(aq/home/*/junk\(aq backup /# Exclude the contents of \(aq/home/user/cache\(aq but not the directory itself:$ borg create \-e /home/user/cache/ backup /# The file \(aq/home/user/cache/important\(aq is *not* backed up:$ borg create \-e /home/user/cache/ backup / /home/user/cache/important# The contents of directories in \(aq/home\(aq are not backed up when their name# ends in \(aq.tmp\(aq$ borg create \-\-exclude \(aqre:^/home/[^/]+\e.tmp/\(aq backup /# Load exclusions from file$ cat >exclude.txt <<EOF# Comment line/home/*/junk*.tmpfm:aa:something/*re:^/home/[^/]\e.tmp/sh:/home/*/.thumbnailsEOF$ borg create \-\-exclude\-from exclude.txt backup /.ft P.fi.UNINDENT.UNINDENT.SH AUTHORThe Borg Collective.\" Generated by docutils manpage writer..
 |