[SOLVED] Using prune

sherani1987

Member
Feb 18, 2021
38
1
8
37
Hi Everyone,
How to use Prune in backup server to keep the last 7 days backup only. please guide me. If i want to keep last 7 days backup. is that correct setting in below image. Also do i need to setup retention policy for backup on Proxmox Virtual Environment

Thanks
 

Attachments

  • Capture.JPG
    Capture.JPG
    18.8 KB · Views: 197
Last edited:
if you want to keep one backup per day for 7 days , use the setting 'keep-daily' and set it to 7 and leave all other blank
Also do i need to setup retention policy for backup on Proxmox Virtual Environment
this is independent of the pbs pruning schedule
it purely depends on where you want to control the schedule
if you do it on both, neither will respect the setting on the other (meaning it depends on how often they run and when to determine what gets pruned)
for simplicity's sake, i'd either use the pve settings or the pbs setting, but not both together
 
if you want to keep one backup per day for 7 days , use the setting 'keep-daily' and set it to 7 and leave all other blank

this is independent of the pbs pruning schedule
it purely depends on where you want to control the schedule
if you do it on both, neither will respect the setting on the other (meaning it depends on how often they run and when to determine what gets pruned)
for simplicity's sake, i'd either use the pve settings or the pbs setting, but not both together
Thanks for reply. I will keep thr daily and 7 days last. I will activate prune only in pbs
 
Regarding this prune simulator you mentioned. I was testing my prune schedule and noticed something confusing. Considering weekly backups on Tuesdays at 6:00 (for ex.) and keep-daily option as N, the simulator intends to keep N number of weekly backups! Looks like keep-daily and keep-last options do the same thing. Is this a bug or I missing something?
Screenshot_20210507_113223.png
 
no - this is just how the pruning algorithm works. all the keep-foo parameters are cumulative, and only look at windows where there are snapshots. so in your case for keep-daily, it will look at all days with backups and mark one backup per day if there isn't already one marked. days which already have a backup marked are skipped, as are days which have no backups. the same applies to all the other settings (keep-last just looks at all backups, the rest all mark 'one backup per foo' with the above rules).

this has the consequence of keeping more backups than expected when a user misunderstands how it works, rather than less. if you do weekly backups only, you probably don't want to set keep-daily at all.
 
Interesting. It is VM or snapshot related? I mean, I have most of VM's on the same datastore backed up weekly, but some of them have daily backup schedule. Should I expect the same behavior?
 
Interesting. It is VM or snapshot related? I mean, I have most of VM's on the same datastore backed up weekly, but some of them have daily backup schedule. Should I expect the same behavior?

you can check with the simulator what will happen if you don't yet have enough snapshots to see with the prune preview ;)
 
Eu ainda não entendi a função do Prume, alguém poderia me explicar ?
Translated to: "I still don't understand the function of Prume, could someone explain it to me?"

Pruning allows you to retain backups in a flexible and organised manner.
Generally, as time goes on, the required interval between each backup grows. For example, let's say you have a VM that requires daily backups, and you need to retain backups for 5 years. It isn't optimal to keep 1825 individual backups. Instead, you might want to retain:
  • One recent backup that was made manually, e.g. prior to an upgrade (keep-last: 1).
  • One backup for each day of the last week (keep-daily: 7), as in cases of data loss, this will give you access to recent system versions.
  • One backup per week for the last 4 weeks (keep-weekly: 4), as this will be "good enough" if you for some reason need to access an older machine version (e.g., trouble after a recent software upgrade).
  • One backup per month for the last year (keep-monthly: 11). Throughout the year perhaps there were major software changes, and you need an older version to check when bugs were introduced or to access an old, deleted database.
  • One backup per year for the last 5 years (keep-yearly: 4). For archiving old data, for example, due to legal requirements.
Pruning allows you to set this retention schedule automatically. You just need to set your preference, and Proxmox Backup Server will manage your backups accordingly.
 
  • 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!