prune_backups
Remove old backups per stage while retaining the latest N. Preview with dry-run to confirm before deleting.
Instructions
Remove older backups, keeping the most recent N per stage.
Default is dry_run=True — the response shows what WOULD
be deleted without touching disk, so the caller can confirm
before committing. Pass dry_run=False to actually delete.
When stage is None (default), only auto-retention stages
(session / weekly / monthly) are pruned. Manual backups are
never auto-pruned; target them explicitly with
stage="manual".
Args:
keep_last_n: Number of backups to retain per affected
stage. Must be >= 0.
stage: If set, only prune within this stage. One of
session, weekly, monthly, manual.
dry_run: When True (default), report only. When False,
delete.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| stage | No | ||
| dry_run | No | ||
| keep_last_n | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |