| name | prune-snapshots |
| description | Use when the user wants to clean up old snapshots to reclaim space. |
Prune Snapshots
Delete old snapshots by retention policy (count, age, or type).
When to use
- Freeing BTRFS disk space consumed by snapshots
- Enforcing automatic retention limits
- Cleaning up pre/post pair remnants
Inputs to gather
- Snapper config name
- Retention policy: one of:
keep-last <N> (retain N newest snapshots)
older-than <X> days
type <single|pre|post> (filter by type)
Procedure
- Preflight: Verify
snapper is installed and config exists.
- Run
sudo snapper -c <config> list --csvout to enumerate snapshots.
- Filter snapshots by policy (date, type, or rank).
- Display the snapshots to be deleted (ID, date, description). Request confirmation.
- On confirmation: Run
sudo snapper -c <config> delete <ids> for each ID.
- Run
sudo btrfs filesystem usage <mount> before and after to report reclaimed space.
Output / side effects
Snapshots deleted. Displays freed space estimate.
Safety / constraints
Destructive. Always show deletion list first; require confirmation. Requires sudo.