Proxmox Backup Server retention issue

Nexces

Member
May 11, 2022
4
1
8
I've got an issue with backup retention policy in PBS. Namely how `keep-hourly` works.

Documentation clearly states:
keep-hourly <N>
Keep backups for the last <N> hours. If there is more than one backup for a single hour, only the latest is kept. Hours without backups do not count.

However it does not retain backups from last <N> hours but instead it keeps <N> backups that are newest in given hour.

Here are two cases:
1. backup is done every day, every 2 hours
2. backup is done every day at 21:15

Retention policy is set to keep-hourly: 48

My understanding of documentation is that this option will consider 48 hour window and keep newest backup from given hour, so for given two cases:
1. 24 backups are kept
2. 2 backups are kept

But given how this works retention policy is strictly tied to backup schedule. If i would like to keep newest hourly backup for last two days i need to setup different retention policy for both cases:
1. keep-hourly 24
2. keep-hourly 2

It is manageable but it would make more sense to untie retention policy from schedule as schedule is set on client and policy is set on server.
 
My understanding of documentation is
this understanding is wrong. see the prune simulator linked from the documentation. the retention policy is not tied to the schedule, but it also doesn't work based on "windows", it simply goes through the list of existing snapshots and marks them for removal or keeping based on the criteria.
 
  • Like
Reactions: Johannes S
Keep backups for the last <N> hours
This suggests usage of time window.

Hours without backups do not count
However this makes previous statement somewhat inaccurate.

Which in turn makes documentation hard to comprehend.
Furthermore it kinda makes retention policy hard to plan.
 
there's pros and cons to all the different approaches, but we picked one and implemented the simulator precisely to avoid confusion/make it easy to play around with the settings without actually waiting for weeks to find out there's a misunderstanding ;)
 
  • Like
Reactions: Johannes S
there's pros and cons to all the different approaches

You're right about that. So here's is a thought: expand retention definition capabilities to use time windows, either via flag that will change behavior of current time related options, or by adding new options.

Also maybe documentation could use a little touch.Something like "Keep <N> backups that are newest in given hour/day/week/month/year"? This will not suggest usage of "time window" and it could avoid confusion.

And about that simulator...
Could it be fixed to support schedules just like PBS ;) schedule in form 5..23/2:15 throws an error that 23/2 is not an integer (22/2 is also not an integer)
1736834273610.png
 
  • Like
Reactions: Johannes S