Manual/VirtOn PBS (For the sake of mystery.)/PBS Prune and Garbage Collection
Home
VirtOn PBS DocumentationVersion 1.0User Guide

PBS Prune and Garbage Collection

On this page

PBS Prune and Garbage Collection

Prune and Garbage Collection (GC) work together to control the capacity used by backups in Proxmox Backup Server (PBS). They are related, but they do different jobs:

  • Prune applies the retention policy. It removes backup snapshots that are no longer required from the datastore index.
  • Garbage Collection finds data chunks that are no longer referenced by any backup snapshot and removes those chunks from disk.

Run Prune first, then run GC. Pruning alone does not immediately return all disk space because the unreferenced chunks are removed by GC.

6.1 Configure a Prune policy

Use a Prune policy to retain the recovery points your team needs while automatically removing older ones. VirtOn lets you create, edit, delete, review, and run PBS Prune jobs.

Policy fields

  • PBS Server: Select the PBS connection that contains the target datastore.
  • Datastore: Select the datastore to which the policy applies.
  • Namespace: Limit the policy to a namespace. Leave this empty to use the root namespace.
  • Maximum depth (max-depth): Set how far Prune searches below the selected namespace. A value of 0 limits the operation to the current namespace.
  • Schedule: Choose a preset or enter a cron expression, such as hourly, daily, or mon..fri 02:00.
  • Retention policy: Set the number of snapshots to keep for the last, hourly, daily, weekly, monthly, and yearly intervals.
  • Comment: Add an operational note describing the purpose of the policy.
  • Enabled: Enable or pause scheduled execution. A disabled policy is retained but does not run automatically.
  • Job ID: A unique identifier for the policy. It can be generated automatically when the job is created.

Create, edit, and run a policy

  1. Choose the PBS server, datastore, and namespace.
  2. Set a schedule and conservative retention values for the first run.
  3. Save the policy. VirtOn displays the saved policy in the policy list.
  4. To verify the result before the next schedule, select the policy and run Prune manually.
  5. Review the completed task, then run GC if disk capacity needs to be reclaimed.

When editing an existing policy, the Job ID is read-only to prevent accidental changes to the policy identity. Delete only policies that are no longer needed; deletion stops future scheduled Prune jobs but does not remove backups by itself.

6.2 Configure and run Garbage Collection

GC reclaims physical capacity after Prune has removed snapshot references. You can schedule GC for each datastore or run it manually after a large cleanup.

GC schedule and manual execution

  • Select the PBS server and datastore. These values identify the GC target.
  • Choose a preset schedule or enter a cron expression. Clear the schedule to disable automatic execution.
  • Save the GC schedule to apply it to PBS.
  • Use Run Prune to execute a selected Prune policy immediately.
  • Use Run Garbage Collection to start GC immediately for the current datastore.

VirtOn reports the task through its UPID, including progress, status, and final result. Wait for the task to complete before making capacity decisions. In busy environments, avoid scheduling Prune and GC during the backup window because both operations can increase I/O.

6.3 Review status and saved policies

The GC status panel shows the schedule, most recent run time, duration, result, next run, reclaimed data, and data that may still be reclaimable. A reclaimed value of zero can be normal when no backup chunks became unreferenced after the last Prune job.

The saved policy list makes it possible to search, filter, select, edit, and delete Prune jobs. Review the datastore, namespace, depth, schedule, retention values, last run, duration, status, next run, and comment before changing a production policy.

  1. Confirm that the selected PBS server and datastore are correct.
  2. Review the current GC status and the most recent Prune result.
  3. Check that the retention policy preserves the required recovery points.
  4. Run Prune, then run GC when appropriate.
  5. Confirm the task result and reclaimed capacity before closing the maintenance window.

Start with a conservative retention policy. Reducing retention too aggressively can permanently remove recovery points that are still required for operations or compliance.