arcave savepoint remove
Deletes savepoints of the compose project, in the session the command works in, selected either by id or name, or by retention rules.
arcave savepoint remove [id|name...] [flags]
Flags
| Flag | Default | Description |
|---|---|---|
--retain-recent | — | Keep the newest N savepoints and delete the rest; 0 keeps none. |
--retain-for | — | Keep savepoints younger than this duration, e.g. 1w2d3h4m5s. |
--before-date | — | Delete savepoints created before this RFC3339Nano timestamp. |
--dry-run | false | Report what would be deleted, and delete nothing. |
Global flags apply — see the CLI reference.
--retain-for accepts w and d beside Go's own units (h, m, s, ms…), combined. --before-date does not accept a bare date: it wants a full timestamp, 2026-06-01T00:00:00Z.
The two selection modes
By id or name — one or more as positional arguments, mixed freely. An argument that is a canonical UUID is an id; anything else is a name:
arcave savepoint remove 019e843e-1650-7000-8000-000000000000 before-migration
By retention rule — one or more of --retain-recent, --retain-for, --before-date:
arcave savepoint remove --retain-recent 5
The two cannot be mixed, and one of them is required. Both are refusals rather than defaults: a remove with nothing to go on would be a command that deletes everything by accident.
When several retention rules are combined, a savepoint survives if any one of them keeps it. --retain-recent 5 --retain-for 30d keeps the newest five and everything from the last thirty days; it does not intersect them.
--retain-recent 0 and --retain-for 0s delete every savepoint of this compose project in the session the command works in. Other compose projects, other sessions and safety snapshots are untouched. Look with --dry-run first.
Which savepoints a selector reaches
| Selector | Reaches a safety snapshot? |
|---|---|
| An explicit id | Yes |
| An explicit name | No |
--retain-recent, --retain-for, --before-date | No |
A scanning selector cannot delete the last copy of a pre-rollback state by accident. Neither does a name, as in rollback. Removing a safety snapshot here is always deliberate, by id; arcave gc retires them by their own policy.
Output
On a terminal, the final tree of the steps on stderr and a summary on stdout; in a script, or with --format json, JSON on stdout.
- Terminal
- JSON
✔ savepoint.remove 1.0s
└── ✔ savepoint.drop 1/1 0.0s
Removed 1 savepoint:
before-migration · 019e843e-1650-7000-8000-000000000000 · 2026-06-01 19:41
{
"dry_run": false,
"removed": [
{
"id": "019e843e-1650-7000-8000-000000000000",
"name": "before-migration",
"description": "before the v2 schema",
"created_at": "2026-06-01T19:41:12.123456789Z",
"stats": [ … ],
"writable_layers": [ … ],
"images": [ … ],
"spec": { "format": "compose-yaml" },
"not_covered": { … }
}
]
}
| Field | Meaning |
|---|---|
dry_run | Whether anything was actually deleted. |
removed | The savepoints deleted — or, under --dry-run, the ones that would be — oldest first. Each is the whole record. |
Under --dry-run the summary reads Would remove 1 savepoint:, and no tree is drawn. A selection that matches nothing is not an error: it prints Nothing to remove. on a terminal, removed is null in the JSON, and the exit code is 0.
Deletion is permanent. It frees the savepoint's own directory; the deduplicated image blobs and images it shared with other savepoints, and its cdc snapshots, stay where they are. arcave gc deletes the blobs and images no remaining savepoint uses, and forgets and prunes the snapshots; deleting the whole session gives everything back — see session remove.
Errors
| Condition | What happens |
|---|---|
| Ids and retention rules together | cannot combine savepoint ids or names with retain-recent/retain-for/before-date |
| Neither | specify savepoint ids or names, or at least one of retain-recent, retain-for or before-date |
An id or name with --retain-recent 0 | cannot combine savepoint ids or names with retain-recent/retain-for/before-date — 0 is a rule like any other. |
A negative --retain-recent | retain-recent must be zero or positive |
A negative --retain-for, e.g. -1h | retain-for must be zero or positive |
| An unparseable duration | invalid --retain-for "2 weeks": … |
A bare date in --before-date | invalid --before-date "2026-06-01": … — it takes RFC3339Nano. |
| An id or name that is not there | savepoint(s) not found: 019e843e-1650-7000-8000-000000000000, and nothing is deleted. Every such argument is named. There are no partial deletes: one typo in a list of five removes none of them. |
| A name several savepoints carry | 2 savepoints are named "clean"; name one by id instead: 019e843e-1650-7000-8000-000000000000, 019e8488-3ac8-7000-8000-000000000000, and nothing is deleted. |
| An interrupted rollback is marked | rollback to savepoint 019e843e-1650-7000-8000-000000000000 was interrupted (restoring); recover by rolling back to 019e8491-04c8-7000-8000-000000000000. While the marker stands every removal but --dry-run is refused, by id or by rule: its safety snapshot is the remedy. Recover the rollback first. |
| Another arcave run holds the lock | another arcave command is already running in this project. --dry-run takes no lock and is unaffected. |
Each removal uncommits the record first and drops the data second. A removal killed halfway therefore leaves data no record names — invisible to savepoint list — rather than a record pointing at data that is already half gone. What it leaves is named in the log.
Examples
arcave savepoint remove --retain-recent 5 --dry-run
arcave savepoint remove --retain-recent 10
arcave savepoint remove --retain-for 2w
arcave savepoint remove --before-date 2026-06-01T00:00:00Z
arcave savepoint remove --retain-recent 0 --dry-run
arcave savepoint remove --retain-recent 0
arcave savepoint list --include-safety-snapshots
arcave savepoint remove 019e8491-04c8-7000-8000-000000000000
Until you have confirmed the environment, that snapshot is the last copy of the pre-rollback state.
Retention rules do not know which savepoint matters
A seeded clean baseline is deleted by --retain-recent 5 as soon as five newer savepoints exist. A savepoint that has to survive indefinitely is removed around by id or name, never by a rule, or kept in a session of its own that the retention runs never name.
Next step
Storage layout — what a savepoint occupies, and what removing one frees.