Pruning doesn't work

docent

Renowned Member
Jul 23, 2009
96
1
73
Hello,
I don't understand how pruning is working.
Today is the first Monday in August, but as of 03/31/2024 the backup copy has not been deleted.
Why?
2024-08-05T00:00:00+05:00: prune job 'default-PVE01Backup-6c1d041d-a53'
2024-08-05T00:00:00+05:00: task triggered by schedule 'daily'
2024-08-05T00:00:00+05:00: Starting datastore prune on datastore 'PVE01Backup', root namespace, down to full depth
2024-08-05T00:00:00+05:00: retention options: --keep-last 7 --keep-daily 14 --keep-weekly 4 --keep-monthly 3
2024-08-05T00:00:00+05:00: Pruning group :"vm/100"
2024-08-05T00:00:00+05:00: keep vm/100/2024-03-31T16:00:00Z
2024-08-05T00:00:00+05:00: keep vm/100/2024-04-28T17:00:00Z
2024-08-05T00:00:00+05:00: keep vm/100/2024-05-26T17:00:01Z
2024-08-05T00:00:00+05:00: keep vm/100/2024-06-16T17:00:04Z
2024-08-05T00:00:00+05:00: keep vm/100/2024-06-23T17:00:03Z
2024-08-05T00:00:00+05:00: keep vm/100/2024-06-30T17:00:04Z
2024-08-05T00:00:00+05:00: keep vm/100/2024-07-07T17:00:03Z
2024-08-05T00:00:00+05:00: remove vm/100/2024-07-10T17:00:00Z
2024-08-05T00:00:00+05:00: keep vm/100/2024-07-11T17:00:03Z
2024-08-05T00:00:00+05:00: keep vm/100/2024-07-16T17:00:01Z
2024-08-05T00:00:00+05:00: keep vm/100/2024-07-17T17:00:03Z
2024-08-05T00:00:00+05:00: keep vm/100/2024-07-18T17:00:00Z
2024-08-05T00:00:00+05:00: keep vm/100/2024-07-19T17:00:04Z
2024-08-05T00:00:00+05:00: keep vm/100/2024-07-20T17:00:01Z
2024-08-05T00:00:00+05:00: keep vm/100/2024-07-21T17:00:01Z
2024-08-05T00:00:00+05:00: keep vm/100/2024-07-22T17:00:04Z
2024-08-05T00:00:00+05:00: keep vm/100/2024-07-23T17:00:03Z
2024-08-05T00:00:00+05:00: keep vm/100/2024-07-24T17:00:03Z
2024-08-05T00:00:00+05:00: keep vm/100/2024-07-25T17:00:02Z
2024-08-05T00:00:00+05:00: keep vm/100/2024-07-26T17:00:04Z
2024-08-05T00:00:00+05:00: keep vm/100/2024-07-27T17:00:01Z
2024-08-05T00:00:00+05:00: keep vm/100/2024-07-28T17:00:02Z
2024-08-05T00:00:00+05:00: keep vm/100/2024-07-29T17:00:06Z
2024-08-05T00:00:00+05:00: keep vm/100/2024-07-30T17:00:01Z
2024-08-05T00:00:00+05:00: keep vm/100/2024-07-31T17:00:03Z
2024-08-05T00:00:00+05:00: keep vm/100/2024-08-01T17:00:04Z
2024-08-05T00:00:00+05:00: keep vm/100/2024-08-02T17:00:05Z
2024-08-05T00:00:00+05:00: keep vm/100/2024-08-03T17:00:02Z
2024-08-05T00:00:00+05:00: keep vm/100/2024-08-04T17:00:04Z
2024-08-05T00:00:00+05:00: TASK OK

Best regards,
Michael
 
see https://pbs.proxmox.com/docs/backup-client.html#backup-pruning and https://pbs.proxmox.com/docs/prune-simulator/index.html for details, but it does the right thing:

you specified keep-last 7 which are the following:
2024-08-05T00:00:00+05:00: keep vm/100/2024-07-29T17:00:06Z
2024-08-05T00:00:00+05:00: keep vm/100/2024-07-30T17:00:01Z
2024-08-05T00:00:00+05:00: keep vm/100/2024-07-31T17:00:03Z
2024-08-05T00:00:00+05:00: keep vm/100/2024-08-01T17:00:04Z
2024-08-05T00:00:00+05:00: keep vm/100/2024-08-02T17:00:05Z
2024-08-05T00:00:00+05:00: keep vm/100/2024-08-03T17:00:02Z
2024-08-05T00:00:00+05:00: keep vm/100/2024-08-04T17:00:04Z

keep daily 14:

2024-08-05T00:00:00+05:00: keep vm/100/2024-07-11T17:00:03Z
2024-08-05T00:00:00+05:00: keep vm/100/2024-07-16T17:00:01Z
2024-08-05T00:00:00+05:00: keep vm/100/2024-07-17T17:00:03Z
2024-08-05T00:00:00+05:00: keep vm/100/2024-07-18T17:00:00Z
2024-08-05T00:00:00+05:00: keep vm/100/2024-07-19T17:00:04Z
2024-08-05T00:00:00+05:00: keep vm/100/2024-07-20T17:00:01Z
2024-08-05T00:00:00+05:00: keep vm/100/2024-07-21T17:00:01Z
2024-08-05T00:00:00+05:00: keep vm/100/2024-07-22T17:00:04Z
2024-08-05T00:00:00+05:00: keep vm/100/2024-07-23T17:00:03Z
2024-08-05T00:00:00+05:00: keep vm/100/2024-07-24T17:00:03Z
2024-08-05T00:00:00+05:00: keep vm/100/2024-07-25T17:00:02Z
2024-08-05T00:00:00+05:00: keep vm/100/2024-07-26T17:00:04Z
2024-08-05T00:00:00+05:00: keep vm/100/2024-07-27T17:00:01Z
2024-08-05T00:00:00+05:00: keep vm/100/2024-07-28T17:00:02Z

then one is removed
2024-08-05T00:00:00+05:00: remove vm/100/2024-07-10T17:00:00Z

then keep weekly 4

2024-08-05T00:00:00+05:00: keep vm/100/2024-06-16T17:00:04Z
2024-08-05T00:00:00+05:00: keep vm/100/2024-06-23T17:00:03Z
2024-08-05T00:00:00+05:00: keep vm/100/2024-06-30T17:00:04Z
2024-08-05T00:00:00+05:00: keep vm/100/2024-07-07T17:00:03Z

and then keep monthly 3

2024-08-05T00:00:00+05:00: keep vm/100/2024-03-31T16:00:00Z
2024-08-05T00:00:00+05:00: keep vm/100/2024-04-28T17:00:00Z
2024-08-05T00:00:00+05:00: keep vm/100/2024-05-26T17:00:01Z

basically each 'keep-x' is a number slots to be filled, and it's not about the calendar days/months/etc.
 
  • Like
Reactions: UdoB
Thanks)
I thought all options were counted from the current time, like in Veeam B&R.
 
Hello,


Please, could someone help me understand the concept of Proxmox Backup Server´s prune?
The backup is scheduled to run daily at 00:05 and the prune at 03:00.
I would like to keep 14 daily backups, 8 weekly backups, 6 monthly backups and one yearly backup.
PBS has a schedule to run prune daily at 03:00, with the following retention configuration: keep-last: 2, keep-daily: 14, keep-weekly: 8, keep-monthly: 6, keep-yearly: 1
Prune never keeps weekly, monthly or yearly backups, only the last and daily backups.
I would like to better understand how to achieve this.

Thank you very much.

2024-09-30T03:00:00-03:00: prune job 's-ad570651-be4b'
2024-09-30T03:00:00-03:00: task triggered by schedule '03:00'
2024-09-30T03:00:00-03:00: Starting datastore prune on datastore 'zpool', root namespace, down to full depth
2024-09-30T03:00:00-03:00: retention options: --keep-last 2 --keep-daily 14 --keep-weekly 8 --keep-monthly 6 --keep-yearly 1
2024-09-30T03:00:00-03:00: Pruning group Matriz:"vm/401"
2024-09-30T03:00:00-03:00: remove vm/401/2024-09-13T05:00:03Z
2024-09-30T03:00:00-03:00: remove vm/401/2024-09-14T05:00:09Z
2024-09-30T03:00:00-03:00: keep vm/401/2024-09-15T05:00:00Z
2024-09-30T03:00:00-03:00: keep vm/401/2024-09-16T05:00:07Z
2024-09-30T03:00:00-03:00: keep vm/401/2024-09-17T05:00:01Z
2024-09-30T03:00:00-03:00: keep vm/401/2024-09-18T05:00:05Z
2024-09-30T03:00:00-03:00: keep vm/401/2024-09-19T04:30:06Z
2024-09-30T03:00:00-03:00: keep vm/401/2024-09-20T04:30:04Z
2024-09-30T03:00:00-03:00: keep vm/401/2024-09-21T04:30:11Z
2024-09-30T03:00:00-03:00: keep vm/401/2024-09-22T04:30:03Z
2024-09-30T03:00:00-03:00: keep vm/401/2024-09-23T04:30:05Z
2024-09-30T03:00:00-03:00: keep vm/401/2024-09-24T04:30:01Z
2024-09-30T03:00:00-03:00: keep vm/401/2024-09-25T04:30:03Z
2024-09-30T03:00:00-03:00: keep vm/401/2024-09-26T04:30:15Z
2024-09-30T03:00:00-03:00: keep vm/401/2024-09-27T04:30:09Z
2024-09-30T03:00:00-03:00: remove vm/401/2024-09-28T04:30:12Z
2024-09-30T03:00:00-03:00: keep vm/401/2024-09-28T18:40:15Z
2024-09-30T03:00:00-03:00: keep vm/401/2024-09-29T03:05:02Z
2024-09-30T03:00:00-03:00: keep vm/401/2024-09-30T03:05:07Z
2024-09-30T03:00:00-03:00: Pruning group Matriz:"vm/104"
2024-09-30T03:00:00-03:00: remove vm/104/2024-09-14T03:00:14Z
2024-09-30T03:00:00-03:00: keep vm/104/2024-09-15T03:00:15Z
2024-09-30T03:00:00-03:00: keep vm/104/2024-09-16T03:00:25Z
2024-09-30T03:00:00-03:00: keep vm/104/2024-09-17T03:00:16Z
2024-09-30T03:00:00-03:00: keep vm/104/2024-09-18T03:00:22Z
2024-09-30T03:00:00-03:00: keep vm/104/2024-09-19T03:00:17Z
2024-09-30T03:00:00-03:00: keep vm/104/2024-09-20T03:00:17Z
2024-09-30T03:00:00-03:00: keep vm/104/2024-09-21T03:00:13Z
2024-09-30T03:00:00-03:00: keep vm/104/2024-09-22T03:00:18Z
2024-09-30T03:00:00-03:00: keep vm/104/2024-09-23T03:00:21Z
2024-09-30T03:00:00-03:00: keep vm/104/2024-09-24T03:00:20Z
2024-09-30T03:00:00-03:00: keep vm/104/2024-09-25T03:00:22Z
2024-09-30T03:00:00-03:00: keep vm/104/2024-09-26T03:00:20Z
2024-09-30T03:00:00-03:00: keep vm/104/2024-09-27T03:00:25Z
2024-09-30T03:00:00-03:00: remove vm/104/2024-09-28T03:00:18Z
2024-09-30T03:00:00-03:00: remove vm/104/2024-09-28T19:27:10Z
2024-09-30T03:00:00-03:00: keep vm/104/2024-09-28T19:37:45Z
2024-09-30T03:00:00-03:00: keep vm/104/2024-09-29T03:06:23Z
2024-09-30T03:00:00-03:00: keep vm/104/2024-09-30T03:07:24Z
2024-09-30T03:00:00-03:00: Pruning group Matriz:"vm/300"
2024-09-30T03:00:00-03:00: remove vm/300/2024-09-13T05:31:28Z
2024-09-30T03:00:00-03:00: remove vm/300/2024-09-14T05:31:22Z
2024-09-30T03:00:00-03:00: keep vm/300/2024-09-15T05:31:12Z
2024-09-30T03:00:00-03:00: keep vm/300/2024-09-16T05:31:24Z
2024-09-30T03:00:00-03:00: keep vm/300/2024-09-17T05:31:26Z
2024-09-30T03:00:00-03:00: keep vm/300/2024-09-18T05:31:53Z
2024-09-30T03:00:00-03:00: keep vm/300/2024-09-19T05:31:33Z
2024-09-30T03:00:00-03:00: keep vm/300/2024-09-20T05:31:32Z
2024-09-30T03:00:00-03:00: keep vm/300/2024-09-21T05:31:18Z
2024-09-30T03:00:00-03:00: keep vm/300/2024-09-22T05:31:29Z
2024-09-30T03:00:00-03:00: keep vm/300/2024-09-23T05:31:17Z
2024-09-30T03:00:00-03:00: keep vm/300/2024-09-24T05:31:38Z
2024-09-30T03:00:00-03:00: keep vm/300/2024-09-25T05:31:36Z
2024-09-30T03:00:00-03:00: keep vm/300/2024-09-26T05:31:22Z
2024-09-30T03:00:00-03:00: keep vm/300/2024-09-27T05:31:26Z
2024-09-30T03:00:00-03:00: keep vm/300/2024-09-28T05:31:27Z
2024-09-30T03:00:00-03:00: keep vm/300/2024-09-29T05:31:23Z
2024-09-30T03:00:00-03:00: keep vm/300/2024-09-30T05:31:28Z
.....
 
Use prune simulator to find out why or why not a snapshot is kept [1]. Except for the last parameter, which keeps that many snapshots no matter when they were taken, PBS will keep the last backup of each period:

--keep-daily -> the last backup of each day -> that started nearer to 23:59:59.
--keep-weekly -> the last backup of the week -> that started nearer to 23:59:59 of a Sunday.
--keep-monthly -> the last backup of the month -> that started nearer to 23:59:59 of the last day of the month.
--keep-yearly -> the last backup of the year -> that started nearer to 23:59:59 of December 31.

You just have to wait a couple more weeks to see clearer how you retention policy is properly being applied.

[1] https://pbs.proxmox.com/docs/prune-simulator/index.html
 

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!