1
0
Fork 0
mirror of https://github.com/borgbackup/borg.git synced 2025-03-10 06:03:38 +00:00

Improve patterns help

This commit is contained in:
eoli3n 2023-06-11 11:08:31 +02:00
parent c5d579be39
commit 952d778bc1

View file

@ -2311,12 +2311,11 @@ class Archiver:
currently active recursion root. You usually give the recursion root(s) currently active recursion root. You usually give the recursion root(s)
when invoking borg and these can be either relative or absolute paths. when invoking borg and these can be either relative or absolute paths.
If you give `/absolute/` as root, the paths going into the matcher will Starting with Borg 1.2, paths that are matched against patterns always
look relative like `absolute/.../file.ext`, because file paths in Borg appear relative. If you give ``/absolute/`` as root, the paths going
archives are always stored normalized and relative. This means that e.g. into the matcher will start with ``absolute/``.
``borg create /path/to/repo ../some/path`` will store all files as If you give ``../../relative`` as root, the paths will be normalized
`some/path/.../file.ext` and ``borg create /path/to/repo /home/user`` as ``relative/``.
will store all files as `home/user/.../file.ext`.
A directory exclusion pattern can end either with or without a slash ('/'). A directory exclusion pattern can end either with or without a slash ('/').
If it ends with a slash, such as `some/path/`, the directory will be If it ends with a slash, such as `some/path/`, the directory will be
@ -2329,12 +2328,6 @@ class Archiver:
option. For commands that support patterns in their ``PATH`` argument option. For commands that support patterns in their ``PATH`` argument
like (``borg list``), the default pattern is path prefix. like (``borg list``), the default pattern is path prefix.
Starting with Borg 1.2, discovered fs paths are normalised, have leading
slashes removed and then are matched against your patterns.
Note: You need to review your include / exclude patterns and make
sure they do not expect leading slashes. Borg can only deal with this
for some very simple patterns by removing leading slashes there also.
If followed by a colon (':') the first two characters of a pattern are If followed by a colon (':') the first two characters of a pattern are
used as a style selector. Explicit style selection is necessary when a used as a style selector. Explicit style selection is necessary when a
non-default style is desired or when the desired pattern starts with non-default style is desired or when the desired pattern starts with