Retention: Prune Job vs Datastore Config

michael.heider

New Member
Jan 14, 2024
5
3
3
Hi,

Within PBS, there are two places to configure retention:

- in the config of the datastore during datastore creation (visible with sudo proxmox-backup-manager datastore show [datastore], don't know how to see in GUI)
- when creating a prune job (web UI in the Prune & GC Jobs tab of the datastore)

Only setting the retention config in the datastore during creation doesn't seem to actually prune anything, eventhough this also includes prune-schedule (in my case set to daily). Creating a prune job works, but then the retention setting from the prune job is applied, and the one from the datastore config seems to be ignored.

So what is the retention config in the datastore config for?
And what is the proper way to setup automated pruning?

I'm using PBS 3.1.
 
Hi,

Within PBS, there are two places to configure retention:

- in the config of the datastore during datastore creation (visible with sudo proxmox-backup-manager datastore show [datastore], don't know how to see in GUI)
- when creating a prune job (web UI in the Prune & GC Jobs tab of the datastore)

Only setting the retention config in the datastore during creation doesn't seem to actually prune anything, eventhough this also includes prune-schedule (in my case set to daily). Creating a prune job works, but then the retention setting from the prune job is applied, and the one from the datastore config seems to be ignored.

So what is the retention config in the datastore config for?
And what is the proper way to setup automated pruning?

I'm using PBS 3.1.
Hi,
in both cases you will create a prune job for the datastore. However, if you do not specify any retention options for the default prune job during datastore creation, job will have no effect.

In any case it is however shown in the datastores Prune & GC Jobs tab in the UI.

What is the output of cat /etc/proxmox-backup/prune.cfg in your case? That should contain all configured prune jobs for all datastores. Even if not retention settings are configured.
 
Hi Chris,

/etc/proxmox-backup/prune.cfg is indeed an empty file.

But sudo proxmox-backup-manager datastore show [datastore] does confirm that the datastore has pruning settings configured:

Code:
┌────────────────┬──────────────────────────────────────────────┐
│ Name           │ Value                                        │
╞════════════════╪══════════════════════════════════════════════╡
│ name           │ backups                                      │
├────────────────┼──────────────────────────────────────────────┤
│ path           │ /rpool/backup/backups                        │
├────────────────┼──────────────────────────────────────────────┤
│ comment        │ backups                                      │
├────────────────┼──────────────────────────────────────────────┤
│ gc-schedule    │ daily                                        │
├────────────────┼──────────────────────────────────────────────┤
│ notify         │ gc=error,prune=error,sync=error,verify=error │
├────────────────┼──────────────────────────────────────────────┤
│ prune-schedule │ daily                                        │
├────────────────┼──────────────────────────────────────────────┤
│ verify-new     │ 1                                            │
├────────────────┼──────────────────────────────────────────────┤
│ keep-daily     │ 7                                            │
├────────────────┼──────────────────────────────────────────────┤
│ keep-hourly    │ 24                                           │
├────────────────┼──────────────────────────────────────────────┤
│ keep-last      │ 5                                            │
├────────────────┼──────────────────────────────────────────────┤
│ keep-monthly   │ 12                                           │
├────────────────┼──────────────────────────────────────────────┤
│ keep-weekly    │ 4                                            │
├────────────────┼──────────────────────────────────────────────┤
│ keep-yearly    │ 3                                            │
└────────────────┴──────────────────────────────────────────────┘

So my conclusion would be that the config in sudo proxmox-backup-manager datastore show [datastore] doesn't have an effect at all and you need prune jobs either way. But this seems weird.
 
I updated, the problem was persistant.

I believe this was a not-automatically applied change from possibly the 3.1 update already.

My prune settings were configured in /etc/proxmox-backup/datastore.cfg which is no longer the correct place. Instead, prune jobs are datastore independent in /etc/proxmox-backup/prune.cfg.

So I manually cleaned /etc/proxmox-backup/datastore.cfg and created prune jobs with equal settings.

This is considered solved now, thank you.