[SOLVED] understand pruning

luphi

Renowned Member
Nov 9, 2015
82
5
73
2020-07-22T11:00:00+02:00: Starting datastore prune on store "pbs-local"
2020-07-22T11:00:00+02:00: task triggered by schedule 'hourly'
2020-07-22T11:00:00+02:00: retention options: --keep-daily 1 --keep-weekly 7 --keep-monthly 10 --keep-yearly 21
2020-07-22T11:00:00+02:00: Starting prune on store "pbs-local" group "ct/206"
2020-07-22T11:00:00+02:00: keep ct/206/2020-07-17T13:50:12Z
2020-07-22T11:00:00+02:00: remove ct/206/2020-07-21T08:10:14Z
2020-07-22T11:00:00+02:00: keep ct/206/2020-07-22T08:13:52Z
2020-07-22T11:00:00+02:00: Starting prune on store "pbs-local" group "ct/201"
2020-07-22T11:00:00+02:00: keep ct/201/2020-07-17T13:49:15Z
2020-07-22T11:00:00+02:00: remove ct/201/2020-07-21T08:09:15Z
2020-07-22T11:00:00+02:00: keep ct/201/2020-07-22T08:12:51Z
2020-07-22T11:00:00+02:00: Starting prune on store "pbs-local" group "ct/205"
2020-07-22T11:00:00+02:00: keep ct/205/2020-07-17T13:50:07Z
2020-07-22T11:00:00+02:00: remove ct/205/2020-07-21T08:10:08Z
2020-07-22T11:00:00+02:00: keep ct/205/2020-07-22T08:13:45Z

Can someone please explain, why the backups from 21st were deleted?
Since they are the only one on 21st, I expected them to stay.

Cheers,
luphi
 
(edited for clarity since the original reply had the dates swapped)

you have/had three backups:

Code:
ct/206/2020-07-17T13:50:12Z
ct/206/2020-07-21T08:10:14Z
ct/206/2020-07-22T08:13:52Z

now, looking backwards starting from the current time, you keep a backup for the last 1 days. this results in marking the one from the 22nd as 'keep'. now you switch to looking at a weekly granularity. the week that contains the 21st and 22nd already has a snapshot marked as keep, so it is skipped. the next week does not, so the 17th is marked as 'keep' now we've reached our weekly count of 1, and continue look at monthly etc.

it's a bit more obvious what's going in if you have more snapshots from a longer period of time, and play around with the pruning preview..[/code]
 
Last edited:
fixed my original reply to include more details and swap the dates which were wrong ;)
 

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!