# Warden ZFS Snapshots

Use this file when snapshotting or rolling back Warden jail state.

## Snapshot naming rule

Use this format:

```text
<purpose>-DD-mon-YYYY-HHMMSS
```

Examples:

```text
postgres18-ready-08-mar-2026-183600
pre-pgvector-08-mar-2026-190500
pre-upgrade-09-mar-2026-091500
```

Month abbreviations are fixed to this set:

```text
jan feb mar apr maj jun jul avg sep okt nov dec
```

Why:

- day-first stays aligned with the rest of the project
- month abbreviation avoids `02.06.2026` ambiguity
- readable during manual rollback work
- still compact enough for routine operator use

Do not use:

- numeric month-only forms like `20260308`
- ambiguous forms like `02.06.2026`
- spaces
- vague names like `fresh2`

If a machine-readable timestamp is needed later, store it in a ZFS user
property or external metadata. Do not switch snapshot names back to U.S. or
ISO-only date order.

## Control-plane snapshot

```sh
zfs snapshot zroot/clawdie-runtime/jails/controlplane@fresh-08-mar-2026-180000
```

## Database snapshot

```sh
zfs snapshot zroot/clawdie-runtime/jails/db@postgres18-ready-08-mar-2026-183600
```

## Rollback

Always dry-run first:

```sh
# preview
zfs rollback -n zroot/clawdie-runtime/jails/controlplane@fresh-08-mar-2026-180000

# then execute
zfs rollback zroot/clawdie-runtime/jails/controlplane@fresh-08-mar-2026-180000
```

## Inspect datasets and snapshots

```sh
zfs list | grep clawdie-runtime
zfs list -t snapshot | grep clawdie-runtime
```

## Recommended operator policy

- snapshot before major Bastille or jail changes
- snapshot before package upgrades inside `controlplane`
- snapshot `db` after PostgreSQL install and before schema work
- snapshot before structural runtime changes

## Future worker note

Worker jails should remain ephemeral by policy. The primary snapshot target is
the thick persistent `controlplane` jail.
