Skip to main content

dvs backup prune

Remove old snapshots according to retention policy.

Syntax​

dvs backup prune --storage <name> [options]

Options​

OptionDescription
--storage <name>Storage to prune (required)
--keep-last <n>Keep last n snapshots (default: 7)
--keep-daily <n>Keep n daily snapshots (default: 7)
--keep-weekly <n>Keep n weekly snapshots (default: 4)
--keep-monthly <n>Keep n monthly snapshots
--globalPrune all apps (in app context)

Examples​

# Default retention policy
dvs backup prune --storage backup

# Custom retention
dvs backup prune --storage backup \
--keep-last 5 \
--keep-daily 7 \
--keep-weekly 4 \
--keep-monthly 6

# Prune all apps
dvs backup prune --storage backup --global

Retention Policy​

Restic keeps snapshots matching ANY of the criteria:

PolicyKeeps
--keep-last 77 most recent snapshots
--keep-daily 71 per day for 7 days
--keep-weekly 41 per week for 4 weeks
--keep-monthly 61 per month for 6 months

Output​

Pruning snapshots...

Keeping:
abc123de (2025-01-08) - latest
def456gh (2025-01-07) - daily
...

Removing:
old123ab (2024-12-01)
old456cd (2024-11-15)

Freed: 234 MB