📄 Setting up a prune job & garbage collection

Setting up a prune job & garbage collection

There are two primary methods for configuring retention policies in Proxmox Backup Server (PBS). Retention can be managed during the initial integration of a PBS instance into Proxmox VE (PVE), or directly via the datastore configuration on the Proxmox Backup Server itself.

For centralized management, it is recommended to configure retention directly on the PBS datastore. The following procedure outlines this process:

  1. Navigate to your specific Proxmox Backup Server datastore.
  2. Select the Prune & GC tab.
  3. Click on Add Prune Job.
  4. Configure a custom prune job according to your retention requirements. If you wish to test your logic, you can use the official simulator provided by Proxmox: Proxmox Backup Server Prune Simulator. 

  5. ⚠️

    Note: Ensure that the 'Enabled' checkbox is selected to activate the job.

  6. You may limit the depth of the pruning operation by setting a Maximum Depth. For example, setting the maximum depth to 0 restricts the prune job to the current namespace only.

Garbage Collection

Once your Prune Jobs are configured, it is essential to implement Garbage Collection (GC). While the Prune Job marks backups as expired, the Garbage Collector is responsible for the actual physical removal of the underlying data chunks from the storage.

To configure this:

  1. Navigate to the Prune & GC tab.
  2. Under the Garbage Collection section, double-click the Garbage Collection Schedule entry.
  3. Select a predefined schedule or enter a custom cron-based schedule (prefered with random time), then click OK.