From 1911c81cbb016e68d090444cab86d3d57c65e28b Mon Sep 17 00:00:00 2001 From: Andrey Bienkowski Date: Sun, 23 Jan 2022 22:32:15 +0300 Subject: [PATCH 1/2] Revert "docs: excluded parent dir's metadata can't restore. (#6062)" This reverts commit 7e746e10e7f5236400e9a10674392b6bd138bbd3. The commit was modifying auto-generated files instead of their sources. See the next commit for the fix. --- docs/usage/extract.rst.inc | 6 +----- docs/usage/help.rst.inc | 6 ------ 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/docs/usage/extract.rst.inc b/docs/usage/extract.rst.inc index 474dbe7d3..76e3e70b2 100644 --- a/docs/usage/extract.rst.inc +++ b/docs/usage/extract.rst.inc @@ -118,8 +118,4 @@ pass over the archive metadata. .. note:: Currently, extract always writes into the current working directory ("."), - so make sure you ``cd`` to the right place before calling ``borg extract``. - - 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. + so make sure you ``cd`` to the right place before calling ``borg extract``. \ No newline at end of file diff --git a/docs/usage/help.rst.inc b/docs/usage/help.rst.inc index a77816458..c636b7c03 100644 --- a/docs/usage/help.rst.inc +++ b/docs/usage/help.rst.inc @@ -167,12 +167,6 @@ Examples:: a directory, it won't recurse into it and won't discover any potential matches for include rules below that directory. - .. note:: - - It's possible that a sub-directory/file is matched while parent directories are not. - In that case, parent directories are not backed up thus their user, group, permission, - etc. can not be restored. - Note that the default pattern style for ``--pattern`` and ``--patterns-from`` is shell style (`sh:`), so those patterns behave similar to rsync include/exclude patterns. The pattern style can be set via the `P` prefix. From bc69450cb6b9f1c8a72916938cbebc020c1c062d Mon Sep 17 00:00:00 2001 From: Andrey Bienkowski Date: Sun, 23 Jan 2022 23:11:21 +0300 Subject: [PATCH 2/2] Docs: excluded parent dir's metadata can't restore The PR #6062 made a mistake: it updated the generated files instead of the source. This is the fix Refer to discussion in #5680. --- src/borg/archiver.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/borg/archiver.py b/src/borg/archiver.py index 75f4b355f..6a0d5f516 100644 --- a/src/borg/archiver.py +++ b/src/borg/archiver.py @@ -2369,6 +2369,12 @@ class Archiver: a directory, it won't recurse into it and won't discover any potential matches for include rules below that directory. + .. note:: + + It's possible that a sub-directory/file is matched while parent directories are not. + In that case, parent directories are not backed up thus their user, group, permission, + etc. can not be restored. + Note that the default pattern style for ``--pattern`` and ``--patterns-from`` is shell style (`sh:`), so those patterns behave similar to rsync include/exclude patterns. The pattern style can be set via the `P` prefix. @@ -3878,6 +3884,10 @@ class Archiver: Currently, extract always writes into the current working directory ("."), so make sure you ``cd`` to the right place before calling ``borg extract``. + + 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. """) subparser = subparsers.add_parser('extract', parents=[common_parser], add_help=False, description=self.do_extract.__doc__,