Run retention pruning on a predictable schedule—often after successful daily or weekly backups—but compact only as the backup tool requires and when reclaimable space justifies the I/O. Prune selects expired recovery points; compaction or repacking reclaims storage.
The commands and costs differ between Borg, restic, and other deduplicating repositories. A safe schedule must account for write churn, repository locks, remote bandwidth, free space, and how long maintenance blocks new backups. This distinction sets the measurement method, safety margin, and stop condition. This distinction sets the measurement method, safety margin, and stop condition.
Separate retention decisions from space reclamation
Pruning enforces the recovery-point policy. It should happen often enough that expired snapshots do not accumulate unpredictably, but only after the newest backup is verified and the keep rules are reviewed.
Compaction rewrites or removes repository packs and may transfer substantial data. Running it after every tiny prune can waste I/O, while never running it can leave deleted data consuming the destination.
Use dry-run output where supported and record the expected keep set. A schedule is unsafe if operators cannot explain which daily, weekly, and monthly points remain afterward.
Trigger maintenance from measurable conditions
Track repository growth, reclaimable bytes, free capacity, prune duration, compact duration, lock contention, and the age of the last successful check. These signals are more useful than a calendar alone.
A small home repository may prune weekly and compact monthly; a high-churn repository may need more frequent maintenance. The correct interval is the one that preserves headroom without overlapping backup or restore windows.
Use the table below as a starting policy, then replace it with observed durations and growth rates.
| Observed state | Verdict | Next action |
|---|---|---|
| Retention changed; little reclaimable data | Prune only | Defer compaction |
| High churn; meaningful reclaimable space | Prune then compact | Run in protected window |
| Low free space or active backup | Unsafe now | Stop and clear the conflict |
Build a safe maintenance sequence
Complete and verify the new backup, run prune in preview mode, apply the retention policy, then compact or repack if the tool reports worthwhile reclaimable space. Never delete repository files manually.
Prevent concurrent writers and confirm enough temporary space for repacking. On remote storage, estimate downloaded and uploaded bytes before starting a job that could exceed the maintenance window.
ZimaSpace’s interrupted-prune diagnostic defines the safe recovery boundary.
Linux Junkies’ Borg and restic workflow shows why prune and space reclamation are separate operations.
Validate retention with an actual restore
List retained points after maintenance and restore a small recent item plus an older item from each retention tier. Repository integrity checks and restore tests answer different questions, so run both.
Monitor the next normal backup for stale locks, missing packs, or unexpected full uploads. A green prune log does not prove clients can resume writing.
Proceed when the keep set matches policy, checks pass, restores succeed, and maintenance fits its window. Stop if free space is too low for repacking, another writer is active, or the dry run removes the last required recovery point.
Support & Tips
More to Read

What Temperature Range Is Acceptable for an NVMe Drive in a Mini PC?
For many consumer NVMe drives, roughly 30–50°C idle and below 70°C sustained is a useful target, but the exact model limit controls.

How Much SSD Space Should a Media Server Reserve for Artwork and Cache?
Start with measured app-data usage plus 50–100% growth headroom; rich preview thumbnails can require far more SSD space than ordinary artwork.

How Many Simultaneous SMB Clients Can a 1GbE NAS Serve Comfortably?
A 1GbE NAS can serve many light clients, but only a few heavy transfers; the shared practical ceiling is roughly 100–115MB/s before other limits.

