From 732ecb29fe460e9a9106903c07cf106b876312a8 Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Sun, 14 Aug 2022 22:01:14 +0200 Subject: [PATCH 1/2] update prune docs, -P is gone, -a replaces it --- src/borg/archiver/prune_cmd.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/borg/archiver/prune_cmd.py b/src/borg/archiver/prune_cmd.py index 25da0e2b9..031bc8c9a 100644 --- a/src/borg/archiver/prune_cmd.py +++ b/src/borg/archiver/prune_cmd.py @@ -193,16 +193,17 @@ class PruneMixIn: archive (and thus still needed). Checkpoint archives are not considered when comparing archive counts against the retention limits (``--keep-X``). - If a prefix is set with -P, then only archives that start with the prefix are + If you use --glob-archives (-a), then only archives that match the GLOB are considered for deletion and only those archives count towards the totals specified by the rules. Otherwise, *all* archives in the repository are candidates for deletion! There is no automatic distinction between archives representing different - contents. These need to be distinguished by specifying matching prefixes. + contents. These need to be distinguished by specifying matching globs. If you have multiple sequences of archives with different data sets (e.g. from different machines) in one shared repository, use one prune call per - data set that matches only the respective archives using the -P option. + data set that matches only the respective archives using the --glob-archives + (-a) option. The ``--keep-within`` option takes an argument of the form "", where char is "H", "d", "w", "m", "y". For example, ``--keep-within 2d`` means From 29ae701ec96ea6f9df729c83a737b660cf734827 Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Wed, 17 Aug 2022 07:41:13 +0200 Subject: [PATCH 2/2] fix test_recreate_timestamp it did not work in timezone utc-0800. --- src/borg/testsuite/archiver.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/borg/testsuite/archiver.py b/src/borg/testsuite/archiver.py index f7ef115f8..4dd8831cd 100644 --- a/src/borg/testsuite/archiver.py +++ b/src/borg/testsuite/archiver.py @@ -3195,7 +3195,6 @@ class ArchiverTestCase(ArchiverTestCaseBase): assert sha256_before == sha256_after def test_recreate_timestamp(self): - local_timezone = datetime.now(timezone(timedelta(0))).astimezone().tzinfo self.create_test_files() self.cmd(f"--repo={self.repository_location}", "rcreate", RK_ENCRYPTION) self.cmd(f"--repo={self.repository_location}", "create", "test0", "input") @@ -3209,8 +3208,8 @@ class ArchiverTestCase(ArchiverTestCaseBase): "test", ) info = self.cmd(f"--repo={self.repository_location}", "info", "-a", "test0").splitlines() - dtime = datetime(1970, 1, 2) + local_timezone.utcoffset(None) - s_time = dtime.strftime("%Y-%m-%d") + dtime = datetime(1970, 1, 2, 0, 0, 0).astimezone() # local time in local timezone + s_time = dtime.strftime("%Y-%m-%d %H:%M:.. %z").replace("+", r"\+") assert any([re.search(r"Time \(start\).+ %s" % s_time, item) for item in info]) assert any([re.search(r"Time \(end\).+ %s" % s_time, item) for item in info])