Skip to main content

dvs archive prune

Remove old archives, keeping only recent ones.

Syntax​

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

Options​

OptionDescription
--storage <name>Storage to prune (required)
--keep-last <n>Keep n most recent archives
--globalPrune all apps (in app context)
--dry-runPreview without deleting
-y, --yes, --forceSkip confirmation

Examples​

# Preview what would be deleted
dvs archive prune --storage backup --keep-last 5 --dry-run

# Keep last 3 archives for current app
dvs archive prune --storage backup --keep-last 3

# Prune all apps, keep 5 each
dvs archive prune --storage backup --keep-last 5 --global

# Non-interactive
dvs archive prune --storage backup --keep-last 3 --yes

Behavior​

ContextBehavior
In appPrunes current app only
In app + --globalPrunes all apps
Outside appPrunes all apps

Output​

Pruning archives (keep-last: 5)...

myapp:
Keep: myapp-20250108-143052, myapp-20250107-091500, ...
Delete: myapp-20250101-120000, myapp-20241231-100000

Delete 2 archives? (y/N) y
Deleted: myapp-20250101-120000
Deleted: myapp-20241231-100000