From 92f1ae6de8b607c31a012dbd6be528ff0b3b12e7 Mon Sep 17 00:00:00 2001 From: Atemu Date: Fri, 20 Dec 2024 09:55:21 +0100 Subject: [PATCH 1/2] extract: document lack of wildcard support in default pattern style Fixes https://github.com/borgbackup/borg/issues/8589 --- src/borg/archiver/extract_cmd.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/borg/archiver/extract_cmd.py b/src/borg/archiver/extract_cmd.py index af22fc5689..ea030d598c 100644 --- a/src/borg/archiver/extract_cmd.py +++ b/src/borg/archiver/extract_cmd.py @@ -130,6 +130,10 @@ def build_parser_extract(self, subparsers, common_parser, mid_common_parser): When parent directories are not extracted (because of using file/directory selection or any other reason), borg can not restore parent directories' metadata, e.g. owner, group, permission, etc. + + The default interpretation for the paths to extract is `pp:` which is a literal + path-prefix match. If you want to use e.g. a wildcard, you must select a different + pattern style such as `sh:` or `fm:`. See :ref:`borg_patterns` for more information. """ ) subparser = subparsers.add_parser( From 3301cb7bd3efd242730f6ccaaa25cf47a9db246b Mon Sep 17 00:00:00 2001 From: Atemu Date: Fri, 20 Dec 2024 09:56:20 +0100 Subject: [PATCH 2/2] doc: add wildcard extract example --- docs/usage/extract.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/usage/extract.rst b/docs/usage/extract.rst index 95703eaf0f..803ef9bedf 100644 --- a/docs/usage/extract.rst +++ b/docs/usage/extract.rst @@ -19,6 +19,9 @@ Examples # Extract the "src" directory but exclude object files $ borg extract my-files home/USERNAME/src --exclude '*.o' + # Extract only the object files + $ borg extract my-files 'sh:home/USERNAME/src/*.o' + # Restore a raw device (must not be active/in use/mounted at that time) $ borg extract --stdout my-sdx | dd of=/dev/sdx bs=10M