Keep last ...

Sep 26, 2023
62
1
8
I've seen the documentation and also the estimator. I've also seen and heard on multiple threads here a difference for what that actually means.
The documentation says this: keep-last = the last # of backup snapshots. Other, previously and older threads have stated that this means that if you have keep-last as 6then there should be 6 copies of the last backup. That said, when you also include other items like hours,daily,weekly, etc and have those numbers set to a higher number than 6 - which is correct? for example, let say I have keep-last as 6 but also have configured keep-daily to 12 and weekly to 4. Is the system going to keep the last 6 copies of 'last' along with 12 daily and 4 weeks which should mean that I have 22 copies of that same server within my environment?

If i have a remote PBR server that is pulling the data from where I have stated last-6,12 daily, and 4 week, is all that data being 'pulled' from there? What if I have different settings on the remote side - say keep-last 2, daily 14 and weekly =12. How many daily should I have at the remote side..only 2 of the keep-last, but (more) daily and (more) weekly files?

Also - if the vm is 60 gb - will I have 60Gb x # of backups in both places, or a single 'rolled up' back with might include 1x60Gb and a bunch of smaller incremental backups?

Reviewing and playing around with the simulator with the different settings and the 'keep-last' set to 14 it shows that after 14 days of 'keep-last' the retention changes over to whatever # i have for daily. Is this correct - meaning that if i have keep-last set as 14 and then daily set to 30 I only have 44 days of backups and then after the 14-day is set..I only have daily backups? If that's true, why would you want to use the keep-last option if you are only going to have daily/weekly/etc backups?
 
Last edited:
Retention settings are related to your backup policy (i.e. when you do your backups). If you only do daily backups, a keep-last=6, keep-daily=15 is exactly the same as keep-daily=21: both will keep 21 daily snapshots with a realtime retention of 21 days.

Now imagine you take 2 backups each day, say at 9:00 and 21:00. The keep-daily=21 policy will keep the last backup of each day for 21 days, so the backup you take at 9:00 would always be pruned. If using keep-last=6, keep-daily=15, PBS will keep the last 6 backups, so for 3 days you would have your 9:00 and 21:00 backups and then just the 21:00 one for 15 days. Total realtime retention in this example would be 18 days instead of 21.

keep-daily keeps the last backup of each day (that closest to 23:59:59) but keep-last will keep that many backups no matter when it was taken.

If i have a remote PBR server that is pulling the data from where I have stated last-6,12 daily, and 4 week, is all that data being 'pulled' from there? What if I have different settings on the remote side - say keep-last 2, daily 14 and weekly =12. How many daily should I have at the remote side..only 2 of the keep-last, but (more) daily and (more) weekly files?
You can have different retention policy on each PBS. The remote one will try to sync all backups from source PBS that are newer than the last it has for each VM/CT. The it will apply it's own Prune policy.

Also - if the vm is 60 gb - will I have 60Gb x # of backups in both places, or a single 'rolled up' back with might include 1x60Gb and a bunch of smaller incremental backups?
Each PBS will have their own independent set of chunks for each backup. How much space they take in the PBS datastore depends on the amount of changed data between backups, how much deduplicatable they are and how compressible they are.

If that's true, why would you want to use the keep-last option if you are only going to have daily/weekly/etc backups?
For me the main use of keep-last is to be sure that an out-of-cycle backup (i.e. one taken manually before an application update) will not be pruned too soon and that it will be kept for a few days. Of course there's the "protected" checkbox too!
 
  • Like
Reactions: fabian

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!