From 770ec1e25aebd7a60c418df1500dac22630224a9 Mon Sep 17 00:00:00 2001 From: Michael Eischer Date: Sat, 16 May 2026 15:59:17 +0200 Subject: [PATCH] doc: clarify ** usage --- doc/040_backup.rst | 5 +++-- doc/faq.rst | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/doc/040_backup.rst b/doc/040_backup.rst index 63d06f741..446af6fd0 100644 --- a/doc/040_backup.rst +++ b/doc/040_backup.rst @@ -402,8 +402,9 @@ This means, ``/bin`` matches ``/bin/bash`` but does not match ``/usr/bin/restic` Regular wildcards cannot be used to match over the directory separator ``/``, e.g. ``b*ash`` matches ``/bin/bash`` but does not match ``/bin/ash``. To match across an arbitrary number of subdirectories, use the special ``**`` wildcard. -The ``**`` must be positioned between path separators. The pattern -``foo/**/bar`` matches: + +The ``**`` must be a **complete path component** (e.g. ``foo/**/bar``, not ``foo**`` or ``foo/**bar``). +The pattern ``foo/**/bar`` matches: * ``/dir1/foo/dir2/bar/file`` * ``/foo/bar/file`` diff --git a/doc/faq.rst b/doc/faq.rst index 204db22ee..c479886de 100644 --- a/doc/faq.rst +++ b/doc/faq.rst @@ -101,7 +101,7 @@ Restic handles globbing and expansion in the following ways: - Environment variables are not expanded in the file read via ``--files-from`` - ``*`` is expanded for paths read via ``--files-from`` - e.g. For backup sources given to restic as arguments on the shell, neither glob expansion nor shell variable replacement is done. If restic is called as ``restic backup '*' '$HOME'``, it will try to backup the literal file(s)/dir(s) ``*`` and ``$HOME`` -- Double-asterisk ``**`` matches across zero or more subdirectories in exclude patterns (e.g. ``foo/**/bar``). This is a custom extension beyond Go's ``filepath.Match``; make sure the shell does not expand it (e.g. by quoting the pattern). See :ref:`backup-excluding-files` for details +- Double-asterisk ``**`` matches across zero or more subdirectories in exclude/include patterns (not ``--files-from``) when it is a complete path component (e.g. ``foo/**/bar``, not ``foo**`` or ``foo/**bar``). This is a custom extension beyond Go's ``filepath.Match``; make sure the shell does not expand it (e.g. by quoting the pattern). See :ref:`backup-excluding-files` for details How can I specify encryption passwords automatically?