[SOLVED] Understanding prune options?

wasteground

Member
Aug 6, 2019
25
2
23
41
Hi!

I am trying to figure out how the prune scheduling works a little better, since I am seeing some results I don't expect (and thus, I am not sure if this is a bug, or just my misunderstanding!).

My schedule is:
last: 1, hourly: 24, daily: 7, weekly: 4, monthly: 12, yearly: 1

My intention with this is:
- always keep at least one backup
- keep 24 hourly backups (if they exist) - for the previous 24 hours
- keep one daily backup for 7 days
- keep one weekly backup for 4 weeks
- keep one monthly backup for 1 year
- keep one annual backup

What I'm seeing is that basically everything is being kept currently for the last 3 weeks since backups began on 1st August, and it seems to be related to my "keep-hourly" setting. That seems to confuse things and cause more backups than I expect to be held. There isn't a lot in the documentation (yet) to explain exactly how this works with examples, but based on my schedule and my intention/understanding from the documentation, I don't think this should be the behaviour.

As an example, I tried to manually run this schedule against a VM which has backed up daily at 05:00 since 1st August, and every backup is kept using the above schedule, nothing is pruned. If I reduce the "keep-hourly" to 1, only backups since 13th August are kept, plus 1st August, and 9th August - which make perfect sense as the monthly and weekly backups I want to keep.

Every time I increment "keep-hourly" by 1, an additional backup day is kept (so setting it to 2, I get backups since 12th August, setting it to 3, I get backups since 11th August, etc).

I can just not keep hourly backups anyway, since right now I'm only doing daily backups it doesn't really matter, but I'd like to make sure I understand it correctly since in future I probably will want some backups running more frequently than once per day.

The only way I can make sense of this is that keep-hourly only makes sense to be set greater than 0 if you're actually doing backups on an hourly basis. Otherwise, it seems that it will just keep the last "keep-hourly" backups for all time, even if those are created on a daily schedule. Maybe my expectation is that it only operates on backups made in the past 24 hours, but this is not the behaviour intended?

Thanks!
 
Hi!

Did you already checked:
https://pbs.proxmox.com/docs/administration-guide.html#pruning-and-removing-backups

The, for your misunderstanding, relevant part should be:
Each option only covers backups within its time period. The next option does not take care of already covered backups. It will only consider older backups.

So, if keep-last touches some backup snapshots, the keep-hourly option will not even check those and start only after that. I.e., those options are to be seen as accumulative.

In addition, keep hourly does not goes over X hours in the past and marks the latest one in such an hour intervall, but rather it goes over all snapshots, and marks the latest in such an hour interval - if there's no backup in one hour-interval it does not count this, again, it is accumulative.

So setting only keep-last to 1 is the same as setting only "keep-hour"ly to 1 (or any other setting, if really just a single one is set).
Setting keep-last AND keep-hourly to one will always keep two backups of a group.

Hope that helps a bit.
 
  • Like
Reactions: flames
Ah! Yep, that does indeed help. I read the docs, but I did not interpret that particular piece correctly, makes much more sense (and I guess that means my assumption on my misunderstanding was correct). Thanks for the clarification!
 

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!