Prune Job: Keep first backup of the day instead of last?

kleumo

New Member
Aug 31, 2023
1
0
1
Hello everyone!

I create backups of my VMs several times a day - during the day using snapshot mode, and at night the stop mode.

When I configure the prune job in PBS to keep, for example, the last 7 daily backups, it always retains the last backup of the day, while all others are deleted. However, I would prefer that the first backup of the day (the one that runs at 3:00 AM) be retained instead, since this one is more consistent due to using the "stop" backup mode.

Is there any way to achieve this?
 
Hey kleumo,

maybe on idea is to use namespaces, one for the snapshot mode backups and one for the stop mode backups and configure different prune options?
 
  • Like
Reactions: Johannes S and UdoB
since this one is more consistent due to using the "stop" backup mode.
If you install qemu-guest-agent on the VM the backup should be as consistent as with stop mode, unless you have some strange application there.

on idea is to use namespaces, one for the snapshot mode backups and one for the stop mode backups
Using two namespaces will require PVE to use two PBS storage, thus losing dirty bitmap when doing backups to the other, although the stop mode backup will lose the dirty map anyways. How useful/needed is dirty map in your case is for the OP to decide, of course.

Instead, I would make backups to one namespace and use a sync job to copy that first backup of the day to another namespace.