Prune Job not pruning.

Lephisto

Well-Known Member
Jun 22, 2019
154
16
58
47
Hi,

I need some clarification about the pruning behaviour of the PBS Server. I usually let the PBS Server do all the pruning to keep permission as restrictive as possible. Essentielly Datastore.Backup is the only Role I need to assign the User.

I have a Datastore with 14 daily, 8 weekly and 6 monthly as retention policy:

1729071206118.png

However, contradictory to what the Pruning Simulator suggests, it keeps Backups older than 6 Months:

Code:
2024-10-16T11:21:59+02:00: Pruning group :"vm/11308"
2024-10-16T11:21:59+02:00: keep vm/11308/2024-01-28T21:35:55Z
2024-10-16T11:21:59+02:00: keep vm/11308/2024-02-25T21:35:40Z
2024-10-16T11:21:59+02:00: keep vm/11308/2024-03-31T20:34:43Z
2024-10-16T11:21:59+02:00: keep vm/11308/2024-04-28T20:40:22Z
2024-10-16T11:21:59+02:00: keep vm/11308/2024-05-26T20:35:25Z
2024-10-16T11:21:59+02:00: keep vm/11308/2024-06-30T20:38:50Z
2024-10-16T11:21:59+02:00: keep vm/11308/2024-07-28T20:44:28Z
2024-10-16T11:21:59+02:00: keep vm/11308/2024-08-04T20:41:14Z
2024-10-16T11:21:59+02:00: keep vm/11308/2024-08-11T20:44:16Z
2024-10-16T11:21:59+02:00: keep vm/11308/2024-08-18T20:48:27Z
2024-10-16T11:21:59+02:00: keep vm/11308/2024-08-25T20:41:32Z
2024-10-16T11:21:59+02:00: keep vm/11308/2024-09-01T20:48:58Z
2024-10-16T11:21:59+02:00: keep vm/11308/2024-09-08T20:53:55Z
2024-10-16T11:21:59+02:00: keep vm/11308/2024-09-15T20:43:58Z
2024-10-16T11:21:59+02:00: keep vm/11308/2024-09-16T20:48:56Z
2024-10-16T11:21:59+02:00: keep vm/11308/2024-09-17T20:46:47Z
2024-10-16T11:21:59+02:00: keep vm/11308/2024-09-18T20:48:10Z
2024-10-16T11:21:59+02:00: keep vm/11308/2024-09-19T20:46:03Z
2024-10-16T11:21:59+02:00: keep vm/11308/2024-09-20T20:44:15Z
2024-10-16T11:21:59+02:00: keep vm/11308/2024-09-21T20:45:55Z
2024-10-16T11:21:59+02:00: keep vm/11308/2024-09-22T20:44:36Z
2024-10-16T11:21:59+02:00: keep vm/11308/2024-09-23T20:46:15Z
2024-10-16T11:21:59+02:00: keep vm/11308/2024-09-24T20:46:16Z
2024-10-16T11:21:59+02:00: keep vm/11308/2024-09-25T20:45:44Z
2024-10-16T11:21:59+02:00: keep vm/11308/2024-09-26T20:46:51Z
2024-10-16T11:21:59+02:00: keep vm/11308/2024-09-27T20:42:52Z
2024-10-16T11:21:59+02:00: keep vm/11308/2024-09-28T20:43:50Z
2024-10-16T11:21:59+02:00: keep vm/11308/2024-09-29T20:42:08Z
2024-10-16T11:21:59+02:00: keep vm/11308/2024-09-30T20:46:32Z
2024-10-16T11:21:59+02:00: keep vm/11308/2024-10-01T20:50:37Z
2024-10-16T11:21:59+02:00: keep vm/11308/2024-10-02T20:49:22Z
2024-10-16T11:21:59+02:00: keep vm/11308/2024-10-03T20:42:49Z
2024-10-16T11:21:59+02:00: keep vm/11308/2024-10-04T20:48:30Z
2024-10-16T11:21:59+02:00: keep vm/11308/2024-10-05T20:49:54Z
2024-10-16T11:21:59+02:00: keep vm/11308/2024-10-06T20:52:08Z
2024-10-16T11:21:59+02:00: keep vm/11308/2024-10-07T20:57:43Z
2024-10-16T11:21:59+02:00: keep vm/11308/2024-10-08T20:50:11Z
2024-10-16T11:21:59+02:00: keep vm/11308/2024-10-09T20:48:36Z
2024-10-16T11:21:59+02:00: keep vm/11308/2024-10-10T20:48:27Z
2024-10-16T11:21:59+02:00: keep vm/11308/2024-10-11T20:46:44Z
2024-10-16T11:21:59+02:00: keep vm/11308/2024-10-12T21:01:10Z
2024-10-16T11:21:59+02:00: keep vm/11308/2024-10-13T20:48:18Z
2024-10-16T11:21:59+02:00: keep vm/11308/2024-10-14T21:03:46Z
2024-10-16T11:21:59+02:00: keep vm/11308/2024-10-15T21:07:12Z

Shouldnt _at least_ the January 2024 Snapshot be pruned?

//update:

what's weird ist, that from somewhere PBS assumes a --keep-yearly 1:

Code:
2024-10-16T11:21:59+02:00: Starting datastore prune on datastore 'px11', root namespace, down to full depth
2024-10-16T11:21:59+02:00: retention options: --keep-daily 30 --keep-weekly 8 --keep-monthly 6 --keep-yearly 1

but i configured this nowhere..

regards
 
Last edited:
Hi!
this is correct afaik, try putting in your exact retention policy in the prune simulator and check out a duration of 50 weeks+. The two things that you are missing are probably:
1) keep-daily N: keeps backups for the last N days and excludes days where there is no backup. This means this option will keep you 1 backup for the last 30 saturdays.
2) the retention options are processed in order and do not overlap. this means that first keep-daily will mark backups as "keep" – then keep-weekly will step in and consider only those backups that are older than the latest marked as "keep". (This is also explained on the prune-simulator page in the "Usage" section.)

On the second issue: the `keep-yearly` should not appear there if you haven't got it configured. Could you double-check your config and maybe post your /etc/proxmox-backup/prune.cfg file?
 
Last edited:
This is exactly what seems weird to me:

Code:
root@<hostname>:/etc/proxmox-backup# grep yearly prune.cfg |wc -l
0

the complete file:

Code:
root@<hostname>:/etc/proxmox-backup# cat prune.cfg
prune: s-292bacf9-6ca5
    keep-daily 30
    keep-monthly 6
    keep-weekly 8
    schedule sat 18:15
    store px11

prune: s-6ab1b284-4e71
    keep-daily 14
    keep-monthly 6
    keep-weekly 3
    schedule hourly
    store A

prune: s-fd600908-2c1f
    keep-daily 7
    keep-monthly 4
    keep-weekly 4
    ns
    schedule hourly
    store B

prune: default-zfs-e3b51add-abac-414c-9
    keep-daily 14
    keep-monthly 6
    keep-weekly 4
    schedule daily
    store zfs

prune: default-pve-X-ee92f8a5-5bff
    schedule daily
    store pve-X

prune: default-Y-679813eb-c87b-4112-
    keep-daily 14
    keep-weekly 8
    schedule daily
    store Y

The issue is that magically the --keep-yearly 1 appears.

I double checked on the PVE Cluster - Storage and Backup Job have no retention set.

weird..
 
Last edited:

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!