Skip to content

borg prune not deleting archive #10520

Open

Description

@dietmargoldbeck

with the current borg 2.0.0b25 i do not see any archive deletions and all lines are prefixed with

keeping archive (rule: secondly #1):

and the counter is not increasing. In my case all archives have separate names (i am using {hostname}.{user}._{utcnow} as name)

Verbose prune run output:

root@brillenpinguin:~/borgbackup/log# borg-2 prune -v --list --keep-secondly 7 
Repository contains 52 archives.
Applying rules to the matching 52 archives...
Group (name='brillenpinguin.root._2026-10-12T19:57:07', host='brillenpinguin'): 1 archives, keeping 1, pruning 0.
Group (name='zwergpinguin-zfs.root._2026-10-12T19:37:11', host='zwergpinguin-zfs'): 1 archives, keeping 1, pruning 0.
Group (name='pve-hwtest.root._2026-10-12T16:55:06', host='pve-hwtest'): 1 archives, keeping 1, pruning 0.
Group (name='pve-hwtest.root._2026-10-11T22:55:07', host='pve-hwtest'): 1 archives, keeping 1, pruning 0.
Group (name='zwergpinguin-zfs.root._2026-10-11T19:38:04', host='zwergpinguin-zfs'): 1 archives, keeping 1, pruning 0.
Group (name='pve-hwtest.root._2026-10-11T16:55:07', host='pve-hwtest'): 1 archives, keeping 1, pruning 0.
Group (name='brillenpinguin.root._2026-10-11T06:54:03', host='brillenpinguin'): 1 archives, keeping 1, pruning 0.
Group (name='pve-hwtest.root._2026-10-10T22:55:11', host='pve-hwtest'): 1 archives, keeping 1, pruning 0.
Group (name='zwergpinguin-zfs.root._2026-10-10T19:38:04', host='zwergpinguin-zfs'): 1 archives, keeping 1, pruning 0.
Group (name='pve-hwtest.root._2026-10-10T16:55:06', host='pve-hwtest'): 1 archives, keeping 1, pruning 0.
Group (name='zuegelpinguin.root._2026-10-10T02:42:03', host='zuegelpinguin'): 1 archives, keeping 1, pruning 0.
Group (name='adeliepinguin.root._2026-10-10T00:45:03', host='adeliepinguin'): 1 archives, keeping 1, pruning 0.
Group (name='pve-hwtest.root._2026-10-09T22:55:06', host='pve-hwtest'): 1 archives, keeping 1, pruning 0.
Group (name='zwergpinguin-zfs.root._2026-10-09T19:38:04', host='zwergpinguin-zfs'): 1 archives, keeping 1, pruning 0.
Group (name='pve-hwtest.root._2026-10-09T16:55:06', host='pve-hwtest'): 1 archives, keeping 1, pruning 0.
Group (name='zwergpinguin-zfs.root._2026-10-09T13:49:03', host='zwergpinguin-zfs'): 1 archives, keeping 1, pruning 0.
Group (name='brillenpinguin.root._2026-10-09T05:54:03', host='brillenpinguin'): 1 archives, keeping 1, pruning 0.
Group (name='pve-hwtest.root._2026-10-08T22:55:07', host='pve-hwtest'): 1 archives, keeping 1, pruning 0.
Group (name='zwergpinguin-zfs.root._2026-10-08T19:37:12', host='zwergpinguin-zfs'): 1 archives, keeping 1, pruning 0.
Group (name='brillenpinguin.root._2026-10-08T17:28:02', host='brillenpinguin'): 1 archives, keeping 1, pruning 0.
Group (name='pve-hwtest.root._2026-10-08T16:55:07', host='pve-hwtest'): 1 archives, keeping 1, pruning 0.
Group (name='brillenpinguin.root._2026-10-08T16:47:09', host='brillenpinguin'): 1 archives, keeping 1, pruning 0.
Group (name='adeliepinguin.root._2026-10-08T16:43:03', host='adeliepinguin'): 1 archives, keeping 1, pruning 0.
Group (name='adeliepinguin.root._2026-10-08T09:09:10', host='adeliepinguin'): 1 archives, keeping 1, pruning 0.
Group (name='adeliepinguin.root._2026-10-08T05:39:10', host='adeliepinguin'): 1 archives, keeping 1, pruning 0.
Group (name='zuegelpinguin.root._2026-10-08T04:37:06', host='zuegelpinguin'): 1 archives, keeping 1, pruning 0.
Group (name='zwergpinguin-zfs.root._2026-10-08T02:57:12', host='zwergpinguin-zfs'): 1 archives, keeping 1, pruning 0.
Group (name='pve-hwtest.root._2026-10-08T02:55:06', host='pve-hwtest'): 1 archives, keeping 1, pruning 0.
Group (name='pve-hwtest.root._2026-10-07T15:55:06', host='pve-hwtest'): 1 archives, keeping 1, pruning 0.
Group (name='brillenpinguin.root._2026-10-07T15:45:03', host='brillenpinguin'): 1 archives, keeping 1, pruning 0.
Group (name='zwergpinguin-zfs.root._2026-10-07T09:19:04', host='zwergpinguin-zfs'): 1 archives, keeping 1, pruning 0.
Group (name='pve-hwtest.root._2026-10-07T07:25:04', host='pve-hwtest'): 1 archives, keeping 1, pruning 0.
Group (name='zuegelpinguin.root._2026-10-07T07:02:03', host='zuegelpinguin'): 1 archives, keeping 1, pruning 0.
Group (name='zuegelpinguin.root._2026-10-07T06:16:02', host='zuegelpinguin'): 1 archives, keeping 1, pruning 0.
Group (name='brillenpinguin.root._2026-10-07T04:57:03', host='brillenpinguin'): 1 archives, keeping 1, pruning 0.
Group (name='zwergpinguin-zfs.root._2026-10-07T02:58:09', host='zwergpinguin-zfs'): 1 archives, keeping 1, pruning 0.
Group (name='brillenpinguin.root._2026-10-06T16:10:03', host='brillenpinguin'): 1 archives, keeping 1, pruning 0.
Group (name='zuegelpinguin.root._2026-10-06T15:16:03', host='zuegelpinguin'): 1 archives, keeping 1, pruning 0.
Group (name='pve-hwtest.root._2026-10-06T09:55:06', host='pve-hwtest'): 1 archives, keeping 1, pruning 0.
Group (name='brillenpinguin.root._2026-10-06T06:54:07', host='brillenpinguin'): 1 archives, keeping 1, pruning 0.
Group (name='zuegelpinguin.root._2026-10-06T06:05:04', host='zuegelpinguin'): 1 archives, keeping 1, pruning 0.
Group (name='zuegelpinguin.root._2026-10-06T05:50:03', host='zuegelpinguin'): 1 archives, keeping 1, pruning 0.
Group (name='zwergpinguin-zfs.root._2026-10-06T02:57:12', host='zwergpinguin-zfs'): 1 archives, keeping 1, pruning 0.
Group (name='zuegelpinguin.root._2026-10-05T22:15:10', host='zuegelpinguin'): 1 archives, keeping 1, pruning 0.
Group (name='pve-hwtest.root._2026-10-05T21:48:03', host='pve-hwtest'): 1 archives, keeping 1, pruning 0.
Group (name='brillenpinguin.root._2026-10-05T03:14:03', host='brillenpinguin'): 1 archives, keeping 1, pruning 0.
Group (name='brillenpinguin.root._2026-10-05T03:06:03', host='brillenpinguin'): 1 archives, keeping 1, pruning 0.
Group (name='zwergpinguin-zfs.root._2026-10-05T01:28:04', host='zwergpinguin-zfs'): 1 archives, keeping 1, pruning 0.
Group (name='brillenpinguin.root._2026-10-04T22:59:03', host='brillenpinguin'): 1 archives, keeping 1, pruning 0.
Group (name='pve-hwtest.root._2026-10-04T17:24:04', host='pve-hwtest'): 1 archives, keeping 1, pruning 0.
Group (name='brillenpinguin.root._2026-10-04T14:29:02', host='brillenpinguin'): 1 archives, keeping 1, pruning 0.
Group (name='borg2selftest', host='brillenpinguin'): 1 archives, keeping 1, pruning 0.
Keeping 52 archives, pruning 0 archives.
Keeping archive (rule: secondly #1):         brillenpinguin.root._2026-10-12T19:57:07 Mon, 2026-10-12 21:57:09 +0200 [d81143d5fc1320bdb233375202fff170ba644d50cdbdb77bdec2d9f3284ab353]
Keeping archive (rule: secondly #1):         zwergpinguin-zfs.root._2026-10-12T19:37:11 Mon, 2026-10-12 21:37:15 +0200 [f2299d3b08aaf7b2b3d8c40e7b2730cc56623eb5360b2cded2e0045ddf3543fd]
Keeping archive (rule: secondly #1):         pve-hwtest.root._2026-10-12T16:55:06 Mon, 2026-10-12 18:55:09 +0200 [728696fa116b27a1e599631838f0076ec05f8a4e26df42cd6e73be9301129eb1]
Keeping archive (rule: secondly #1):         pve-hwtest.root._2026-10-11T22:55:07 Mon, 2026-10-12 00:55:09 +0200 [708e9babfc65aee4509732f2f5df53b81346f198798f457b51582cf05755a8c1]
Keeping archive (rule: secondly #1):         zwergpinguin-zfs.root._2026-10-11T19:38:04 Sun, 2026-10-11 21:38:07 +0200 [657d2e5637904c888696dc0663187e42333b94f1c8ef23070fc94abcaf04ae1b]
Keeping archive (rule: secondly #1):         pve-hwtest.root._2026-10-11T16:55:07 Sun, 2026-10-11 18:55:10 +0200 [b229634b52e8513f5f577e8fd330013b15a0a3ea18331f26560e44656ad14604]
Keeping archive (rule: secondly #1):         brillenpinguin.root._2026-10-11T06:54:03 Sun, 2026-10-11 08:54:06 +0200 [15a7cf991713664823073ebf51ca9c86dab5a64676914b4c1633d67093218efe]
Keeping archive (rule: secondly #1):         pve-hwtest.root._2026-10-10T22:55:11 Sun, 2026-10-11 00:55:15 +0200 [839d50cceae29f861a3553aba3d4a92fcdffec74dc537298937dd69bf435730a]
Keeping archive (rule: secondly #1):         zwergpinguin-zfs.root._2026-10-10T19:38:04 Sat, 2026-10-10 21:38:07 +0200 [ed20d7bfeb3e1c3738116621712ae1660a5e1c8d6c40b83d2a46a1f49cc450d2]
Keeping archive (rule: secondly #1):         pve-hwtest.root._2026-10-10T16:55:06 Sat, 2026-10-10 18:55:09 +0200 [de3c6d76698dc5306468e69060758bce55e67f78c37d3c956625f1bc3d45f780]
Keeping archive (rule: secondly #1):         zuegelpinguin.root._2026-10-10T02:42:03 Sat, 2026-10-10 04:42:07 +0200 [e695052fc5543fa670844a566c055b9ece52fff282ad8495ba879caf0be383a7]
Keeping archive (rule: secondly #1):         adeliepinguin.root._2026-10-10T00:45:03 Sat, 2026-10-10 02:45:06 +0200 [0f3fae5aab9ddcc47339ab26116131253f270ef2ce1e12912bafd84f1e465451]
Keeping archive (rule: secondly #1):         pve-hwtest.root._2026-10-09T22:55:06 Sat, 2026-10-10 00:55:09 +0200 [9f42a06a3a0b3158828c79cff00faa089d9e01bfd4a8972adbe7149513a02cbf]
Keeping archive (rule: secondly #1):         zwergpinguin-zfs.root._2026-10-09T19:38:04 Fri, 2026-10-09 21:38:07 +0200 [eadebcf6b594fa607d69ac4b95b87c3ff53086a41e9327cd78705ec8cdeb67de]
Keeping archive (rule: secondly #1):         pve-hwtest.root._2026-10-09T16:55:06 Fri, 2026-10-09 18:55:09 +0200 [3112e7ccdb4d87e78b7f994ffec3753506e3cda8b8bb553df92c4117c8ca33fc]
Keeping archive (rule: secondly #1):         zwergpinguin-zfs.root._2026-10-09T13:49:03 Fri, 2026-10-09 15:49:06 +0200 [41ed559e9ef8bde060fa7eab1a67c410f88bbd4c46aab42a38d0ced2ca36b690]
Keeping archive (rule: secondly #1):         brillenpinguin.root._2026-10-09T05:54:03 Fri, 2026-10-09 07:54:06 +0200 [386f9e8b48bef1e2dbd57fa0bc13e795b37b016926d41a8461425a9a7ca1ed8b]
Keeping archive (rule: secondly #1):         pve-hwtest.root._2026-10-08T22:55:07 Fri, 2026-10-09 00:55:10 +0200 [0640af101c77463816f10dcbd732691f11c0e6cee244d2130b05defa15b501a1]
Keeping archive (rule: secondly #1):         zwergpinguin-zfs.root._2026-10-08T19:37:12 Thu, 2026-10-08 21:37:15 +0200 [f64230fe904cba5aa936a27d9733ef9145026d70c86ccf9aae78dff698de2c7c]
Keeping archive (rule: secondly #1):         brillenpinguin.root._2026-10-08T17:28:02 Thu, 2026-10-08 19:28:05 +0200 [61b5e0a33020e303972af6bac7f790039a6879ea2503aa69de792e19bd4da611]
Keeping archive (rule: secondly #1):         pve-hwtest.root._2026-10-08T16:55:07 Thu, 2026-10-08 18:55:09 +0200 [eb3c68046635686051e5188095669790dd55f92ce50f35e70e95338d61eda03b]
Keeping archive (rule: secondly #1):         brillenpinguin.root._2026-10-08T16:47:09 Thu, 2026-10-08 18:47:12 +0200 [da6624694ce742e08698adebea877202b0b5e707379dda562e611534763ec9dd]
Keeping archive (rule: secondly #1):         adeliepinguin.root._2026-10-08T16:43:03 Thu, 2026-10-08 18:43:05 +0200 [1518eb23fcb934ac9ba19ce7a26c362f2a423e59ba5caf7a1237771bd6ae2e38]
Keeping archive (rule: secondly #1):         adeliepinguin.root._2026-10-08T09:09:10 Thu, 2026-10-08 11:09:13 +0200 [22cd4cb0fcced99ed243249f58ca8275bfff0727892d48e69b90e8ff6f5084fa]
Keeping archive (rule: secondly #1):         adeliepinguin.root._2026-10-08T05:39:10 Thu, 2026-10-08 07:39:13 +0200 [eb64e2e672ef2c30ea46cffdcae191fadbde5bb090a91acabfd9ea56c38c3b50]
Keeping archive (rule: secondly #1):         zuegelpinguin.root._2026-10-08T04:37:06 Thu, 2026-10-08 06:37:10 +0200 [0c71315b4a394fc4f29db3d4d172ca8353b6a8529dbdccece6de371b050b6907]
Keeping archive (rule: secondly #1):         zwergpinguin-zfs.root._2026-10-08T02:57:12 Thu, 2026-10-08 04:57:14 +0200 [cf4d70bcaf34c4502bcb4936c36268b7cf838db9c65f0bd26cb2c2b511b72faa]
Keeping archive (rule: secondly #1):         pve-hwtest.root._2026-10-08T02:55:06 Thu, 2026-10-08 04:55:09 +0200 [7f710d4fa4d3c945c4f7a3a8b452c920345c2afe14cf0b79253baef5f397916c]
Keeping archive (rule: secondly #1):         pve-hwtest.root._2026-10-07T15:55:06 Wed, 2026-10-07 17:55:08 +0200 [3aea643b8dae51d8515545bf35273bc005eea215ce163c5310a7545116c8ee24]
Keeping archive (rule: secondly #1):         brillenpinguin.root._2026-10-07T15:45:03 Wed, 2026-10-07 17:45:05 +0200 [cc760f50debf0ace4dd19b93decc2135a935d88038b4031ea17b63b6bdcea735]
Keeping archive (rule: secondly #1):         zwergpinguin-zfs.root._2026-10-07T09:19:04 Wed, 2026-10-07 11:19:06 +0200 [c3a4c7b9d83f37cb58bc771c7f1459f4d43a6ddffd74bc4a48afba697a27c547]
Keeping archive (rule: secondly #1):         pve-hwtest.root._2026-10-07T07:25:04 Wed, 2026-10-07 09:25:06 +0200 [86e086fd00ef4691c42946a1f475356019af915bb6c803fe104eb2e08f7bcad1]
Keeping archive (rule: secondly #1):         zuegelpinguin.root._2026-10-07T07:02:03 Wed, 2026-10-07 09:02:07 +0200 [245e9cd4bdc59e97dadce17628a98bc1cd08e55764221fd5936ab7222a41088f]
Keeping archive (rule: secondly #1):         zuegelpinguin.root._2026-10-07T06:16:02 Wed, 2026-10-07 08:16:06 +0200 [693977d1ab858967897d850db59633adcb41afdcd2b2aeb2d05eb2dd333c1834]
Keeping archive (rule: secondly #1):         brillenpinguin.root._2026-10-07T04:57:03 Wed, 2026-10-07 06:57:05 +0200 [a33ffd27d578a44c6072b14480ab308589f6cde116d6af3c2dc77d66cfcce2a3]
Keeping archive (rule: secondly #1):         zwergpinguin-zfs.root._2026-10-07T02:58:09 Wed, 2026-10-07 04:58:12 +0200 [f482cdeaad5ef4a980e7bffa28d60b4a7a371f8baf95c13c458343aaa239628b]
Keeping archive (rule: secondly #1):         brillenpinguin.root._2026-10-06T16:10:03 Tue, 2026-10-06 18:10:07 +0200 [4343ed4319b927c3466538a65d38d5bad6b823e5b94d5a089f232fb6f58d9382]
Keeping archive (rule: secondly #1):         zuegelpinguin.root._2026-10-06T15:16:03 Tue, 2026-10-06 17:16:06 +0200 [27158e29da35e7b430b6831b3beca39411878e86814fe29d17b3612d78108be0]
Keeping archive (rule: secondly #1):         pve-hwtest.root._2026-10-06T09:55:06 Tue, 2026-10-06 11:55:09 +0200 [2ed473162797a5b274047065b8fcb552596e079be736c0bfee1ac5ce1eaa52f5]
Keeping archive (rule: secondly #1):         brillenpinguin.root._2026-10-06T06:54:07 Tue, 2026-10-06 08:54:10 +0200 [9dcbdac2007f8cc02f2a4e8635aa12769611985e4ce25f92624200aed5eaea01]
Keeping archive (rule: secondly #1):         zuegelpinguin.root._2026-10-06T06:05:04 Tue, 2026-10-06 08:05:08 +0200 [4d635e341b75f1c4c3daa6caaa94b64856ac6a2afd40290c5ab1e60ce81ee636]
Keeping archive (rule: secondly #1):         zuegelpinguin.root._2026-10-06T05:50:03 Tue, 2026-10-06 07:50:06 +0200 [bb2f94896419079c66930fb2a0d9c81f67436e6acf674f7bdc60cd1f59cc9452]
Keeping archive (rule: secondly #1):         zwergpinguin-zfs.root._2026-10-06T02:57:12 Tue, 2026-10-06 04:57:14 +0200 [815aab84a4f6914178392c6b2c0c1c40603da5bb6cadd600bb31aab359befee6]
Keeping archive (rule: secondly #1):         zuegelpinguin.root._2026-10-05T22:15:10 Tue, 2026-10-06 00:15:13 +0200 [bc4511e16a3a2f84bbe8d42a9bd82501f1897ce47be61094cbe1d3f126442b8b]
Keeping archive (rule: secondly #1):         pve-hwtest.root._2026-10-05T21:48:03 Mon, 2026-10-05 23:48:06 +0200 [d7711dfa5bac955b71bb81b0006b80f8e0c66e387216a837b2d25996f11c4c6c]
Keeping archive (rule: secondly #1):         brillenpinguin.root._2026-10-05T03:14:03 Mon, 2026-10-05 05:14:06 +0200 [4597d03a3cd618021b1170b98e086efe0c17f6a8a29e634e87dbdd465f062a1e]
Keeping archive (rule: secondly #1):         brillenpinguin.root._2026-10-05T03:06:03 Mon, 2026-10-05 05:06:05 +0200 [2ebf2f22e261c1e9f62d746cb2db43bda2599e5b3cf26ff73aa29d13cc038a9a]
Keeping archive (rule: secondly #1):         zwergpinguin-zfs.root._2026-10-05T01:28:04 Mon, 2026-10-05 03:28:07 +0200 [a126e2170487c4d1b0f54e6361edce67004215c973f5fb8d2b5c7d7e41bb079d]
Keeping archive (rule: secondly #1):         brillenpinguin.root._2026-10-04T22:59:03 Mon, 2026-10-05 00:59:06 +0200 [fbeaa53d154622ccc930f90461c790e1a665cb2e93f8f9c0bf9e539c7cdca4b4]
Keeping archive (rule: secondly #1):         pve-hwtest.root._2026-10-04T17:24:04 Sun, 2026-10-04 19:24:07 +0200 [3c4219ad8cf77fc1023179758ac917412c2d248f5b22365f1f67184c1562625a]
Keeping archive (rule: secondly #1):         brillenpinguin.root._2026-10-04T14:29:02 Sun, 2026-10-04 16:29:11 +0200 [4e8e67d4c062aa4071caeb1bf578e6f7eddee6b7aa9b04ed3a0c9dfc446e9c00]
Keeping archive (rule: secondly #1):         borg2selftest                        Sun, 2026-10-04 12:47:32 +0200 [f281e4e49b993d653d7950dc7cc526f6c9057baf785c78a6661ed4fa76eac392]

Activity

  1. ThomasWaldmann commented on Oct 12, 2026

    @ThomasWaldmann
    Member

    Hi, thanks for the detailed report. This is not a bug in prune, but a consequence of how borg 2 groups archives.

    What happens

    Since 2.0.0b24, borg prune applies the retention rules to each group of archives separately. The default grouping is --group-by name,host, which means one retention policy per archive series name and host.

    Your archive names contain the timestamp ({hostname}.{user}._{utcnow}), so every archive has a different name. Each one therefore forms its own group of one archive, as your output shows (Group (name=...): 1 archives, keeping 1, pruning 0). A single archive is always the newest in its group, so --keep-secondly 7 keeps it as secondly #1 and nothing is ever pruned.

    I reproduced this locally: 4 archives with unique names, --keep-secondly 2 keeps all 4. With --group-by host, it keeps 2 and prunes 2.

    Workaround

    Group by attributes that are stable across your archives, so they are not split by name:

    borg prune -v --list --keep-secondly 7 --group-by host,user

    This applies the rules per host and user. Use --group-by host if you want to ignore the user. Please try it with --dry-run first to check what would be pruned.

    Recommended naming

    In borg 2, the archive timestamp, the hostname and the user are all stored separately in the archive metadata, so none of them belong in the archive name. The name should describe the contents of the backup, for example docs, homes, system or pictures. All archives of the same data share that name and form a series. The host and user are then used by --group-by (default name,host) to keep different machines' backups apart.

    With such names, borg list, borg prune etc. work per series without extra options, and the default grouping does what you'd expect. You can still select by origin with -a host:brillenpinguin or -a user:root.

    If you switch the naming scheme, the old archives with timestamped names still need --group-by host,user (or similar) until they have been pruned away.

    I'll look at making the docs for --group-by and the prune help clearer about this pitfall, since it is easy to run into.

  2. added this to the 2.0.0b26 milestone on Oct 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions