Skip to main content

Prune savepoints with retention rules

A loop that snapshots on every iteration will fill a disk. savepoint remove is how you bound it, and arcave gc is how you get the space back.

What it shows: three cdc savepoints, savepoint rm --retain-recent 1, then arcave gc --dry-run listing what would be freed — the removed savepoints' restic snapshots and image blobs — and arcave gc freeing it.

1. See what you have​

arcave savepoint list
stdout
NAME ID CREATED VOLUMES LAYERS STORED NOT COVERED
attempt-7 019e84d4-d040-7000-8000-000000000000 2026-06-01 22:56 3 3 49.6 MB -
attempt-6 019e84c7-14a0-7000-8000-000000000000 2026-06-01 22:41 3 3 49.4 MB -
attempt-5 019e84b9-5900-7000-8000-000000000000 2026-06-01 22:26 3 3 49.3 MB -
attempt-4 019e84ab-9d60-7000-8000-000000000000 2026-06-01 22:11 3 3 49.2 MB -
attempt-3 019e849d-e1c0-7000-8000-000000000000 2026-06-01 21:56 3 3 49.1 MB -
clean 019e83ff-30c0-7000-8000-000000000000 2026-06-01 18:36 3 3 273 MB -

One row per savepoint. In the JSON each entry is the full savepoint record — stats, writable_layers, images, spec and the rest; the samples on this page keep only the fields that tell the savepoints apart.

The listing is newest first; --sort asc turns it around.

2. Always preview first​

arcave savepoint remove --retain-recent 3 --dry-run
stdout
Would remove 3 savepoints:
clean · 019e83ff-30c0-7000-8000-000000000000 · 2026-06-01 18:36
attempt-3 · 019e849d-e1c0-7000-8000-000000000000 · 2026-06-01 21:56
attempt-4 · 019e84ab-9d60-7000-8000-000000000000 · 2026-06-01 22:11

The savepoints are listed oldest first. clean is in that list. This is exactly why you dry-run first — retention rules do not know which savepoint matters.

A savepoint remove --dry-run takes no project lock, because it only reads.

3. Combine rules to spare the baseline​

arcave savepoint remove --retain-recent 3 --retain-for 6h --dry-run

Rules are combined with OR: a savepoint survives if any rule keeps it. That does not save clean here — it is both outside the newest three and older than six hours — but it does show the semantics:

stdout
Would remove 1 savepoint:
clean · 019e83ff-30c0-7000-8000-000000000000 · 2026-06-01 18:36

attempt-3 and attempt-4 now survive on the time rule even though the count rule would have dropped them.

4. Remove by name when a savepoint is precious​

arcave savepoint remove attempt-3 attempt-4
stderr + stdout
✔ savepoint.remove 1.0s
└── ✔ savepoint.drop 2/2 0.0s

Removed 2 savepoints:
attempt-3 · 019e849d-e1c0-7000-8000-000000000000 · 2026-06-01 21:56
attempt-4 · 019e84ab-9d60-7000-8000-000000000000 · 2026-06-01 22:11

Ids and names mix freely. Deletion is all-or-nothing: one unknown id or name in a list of five is an error and removes none of them:

arcave savepoint remove attempt-4 attempt-9
stderr
Error: savepoint(s) not found: attempt-9

attempt-4 is still there.

5. What you cannot do​

arcave savepoint remove attempt-4 --retain-recent 3
stderr
Error: cannot combine savepoint ids or names with retain-recent/retain-for/before-date
arcave savepoint remove
stderr
Error: specify savepoint ids or names, or at least one of retain-recent, retain-for or before-date

Neither is a default. A remove with nothing to go on would be a command that deletes everything by accident.

An explicit --retain-recent 0 is not "nothing to go on": it is a rule that keeps none, and deletes every savepoint the scan sees.

6. Retention in a scheduled job​

prune.sh
#!/usr/bin/env bash
set -euo pipefail

export ARCAVE_COMPOSE_PROJECT_NAME=arcave-demo

arcave --log-format json savepoint remove --retain-for 7d --retain-recent 5
arcave --log-format json gc

The OR semantics are what you want here: the newest five survive no matter how old they are, and everything from the last week survives no matter how many there are.

7. Retiring safety snapshots​

Retention rules never see safety snapshots, and neither does a name. Every rollback of a running project leaves one, and arcave gc retires them: each compose project keeps its newest gc.safety_snapshots.retain_recent, one by default. gc runs only when you run it, so run it periodically, or right after each rollback:

arcave rollback before-migration && arcave gc

With fullcopy, each safety snapshot is a full copy of the volumes until then. To remove one by hand, find it explicitly:

arcave savepoint list --include-safety-snapshots \
| jq -r '.[] | select(.labels."arcave-safety-snapshot" == "true") | "\(.id) before rollback to \(.taken_before_rollback_to | if .name != "" then .name else .id end)"'
019e8491-04c8-7000-8000-000000000000 before rollback to before-migration
arcave savepoint remove 019e8491-04c8-7000-8000-000000000000

While the rollback that left it is unrecovered — .arcave/inflight.json still stands — every removal that is not a --dry-run is refused, because the safety snapshot may be the way back:

stderr
Error: rollback to savepoint 019e843e-1650-7000-8000-000000000000 was interrupted (restoring); recover by rolling back to 019e8491-04c8-7000-8000-000000000000

The log line before it names the rollback that recovers. Run that first; the removal works once the marker is cleared.

warning

Only after you are certain you do not need the pre-rollback state it holds: a safety snapshot is the last copy of that state, and the only way to undo its rollback — see Troubleshooting.

8. Reclaim the space​

savepoint remove, like gc retiring a safety snapshot, deletes a savepoint's record and its own directory. What it shared with other savepoints — the deduplicated image blobs and images, and with the cdc backend its restic snapshots — stays in the store until arcave gc finds no savepoint using it:

arcave gc --dry-run # what would be freed, nothing deleted
arcave gc # delete it

gc covers every compose project of the session at once, so it takes no -p. An unused image's layers go on the run after the image, and what only a retired safety snapshot held on the run after that one, so a second run can free more — see gc frees space in more than one run. In a scheduled job, run arcave gc after the retention step.

Reducing what a savepoint costs in the first place​

Retention bounds how many savepoints you keep. The cdc backend bounds what each one costs:

.arcave/config.yaml
snapshot:
backend: cdc

Each volume gets a restic repository that outlives any one savepoint, and a capture writes only the chunks that changed. A twenty-iteration loop stops costing twenty full copies.

Existing fullcopy savepoints keep working — a rollback reads the backend out of the record it restores.

Tools and expertise for reproducible, production-like environments.
Copyright © 2026 Greenmask, Inc.
Privacy Policy