mirror of
https://github.com/octoleo/restic.git
synced 2024-11-29 08:14:03 +00:00
doc: Polish exclude file documentation
This commit is contained in:
parent
f7316cea07
commit
556caa326f
@ -227,7 +227,8 @@ This instructs restic to exclude files matching the following criteria:
|
|||||||
Patterns use `filepath.Glob <https://golang.org/pkg/path/filepath/#Glob>`__ internally,
|
Patterns use `filepath.Glob <https://golang.org/pkg/path/filepath/#Glob>`__ internally,
|
||||||
see `filepath.Match <https://golang.org/pkg/path/filepath/#Match>`__ for
|
see `filepath.Match <https://golang.org/pkg/path/filepath/#Match>`__ for
|
||||||
syntax. Patterns are tested against the full path of a file/dir to be saved,
|
syntax. Patterns are tested against the full path of a file/dir to be saved,
|
||||||
even if restic is passed a relative path to save.
|
even if restic is passed a relative path to save. Empty lines and lines
|
||||||
|
starting with a ``#`` are ignored.
|
||||||
|
|
||||||
Environment variables in exclude files are expanded with `os.ExpandEnv
|
Environment variables in exclude files are expanded with `os.ExpandEnv
|
||||||
<https://golang.org/pkg/os/#ExpandEnv>`__, so ``/home/$USER/foo`` will be
|
<https://golang.org/pkg/os/#ExpandEnv>`__, so ``/home/$USER/foo`` will be
|
||||||
@ -245,11 +246,10 @@ Patterns need to match on complete path components. For example, the pattern ``f
|
|||||||
A trailing ``/`` is ignored, a leading ``/`` anchors the pattern at the root directory.
|
A trailing ``/`` is ignored, a leading ``/`` anchors the pattern at the root directory.
|
||||||
This means, ``/bin`` matches ``/bin/bash`` but does not match ``/usr/bin/restic``.
|
This means, ``/bin`` matches ``/bin/bash`` but does not match ``/usr/bin/restic``.
|
||||||
|
|
||||||
Regular wildcards cannot be used to match over the directory separator ``/``.
|
Regular wildcards cannot be used to match over the directory separator ``/``,
|
||||||
For example: ``b*ash`` matches ``/bin/bash`` but does not match ``/bin/ash``.
|
e.g. ``b*ash`` matches ``/bin/bash`` but does not match ``/bin/ash``. For this,
|
||||||
|
the special wildcard ``**`` can be used to match arbitrary sub-directories: The
|
||||||
For this, the special wildcard ``**`` can be used to match arbitrary
|
pattern ``foo/**/bar`` matches:
|
||||||
sub-directories: The pattern ``foo/**/bar`` matches:
|
|
||||||
|
|
||||||
* ``/dir1/foo/dir2/bar/file``
|
* ``/dir1/foo/dir2/bar/file``
|
||||||
* ``/foo/bar/file``
|
* ``/foo/bar/file``
|
||||||
|
Loading…
Reference in New Issue
Block a user