machin-vault icon: a stack of backup versions with a restore arrow

machin-vault

One self-hostable binary that backs up files and databases — and, when something is lost, lets an agent recover it in one glance.

Experimental, unaudited. A dogfooding project for the machin language that runs real backups for its author. Current release: v0.3.0, with per-target age encryption and secrets. All limits.
# "My database is gone — can you get it back?"
$ machin-vault list orders-db                 # 1. glance: newest is 6h old, sha 58c9d2d7
$ machin-vault get orders-db --to /tmp/rec     # 2. drop the raw artifact somewhere safe
$ machin-vault unpack orders-db --to /tmp/rec  # 3. or decrypt + decompress it to inspect
$ machin-vault restore orders-db --yes         # 4. restore via the db's native tool

{"version":"1","ok":true,"targets":[{"name":"orders-db","kind":"postgres","count":14,
  "versions":[{"v":"2026-06-29T03:00:01Z","age":"6h","sha":"58c9d2d71b6c","encrypted":true,...}]}]}
1 binaryCLI, scheduler, dashboard
0 depsstatic Linux x86_64 build
5 kindsfile, postgres, mysql, mongo, custom
~2k linesof MFL in src/

Built to be read — by you and by an agent

No daemon is needed to read a backup: it is just files named <target>_<unixtime>_<sha>.<ext>.

Agent-first contract

One JSON object per answer, help-json catalog, semantic exit codes (80 input · 90 not found · 100 integration · 110 internal). restore refuses to run without --yes.

Real tools, orchestrated

pg_dump, mysqldump, mongodump, rsync or any shell command — over ssh or inside docker exec. It never reimplements them.

Dedup + retention

Content-addressed: an unchanged backup is skipped. Keep the newest N versions per target.

Per-target age encryption

Opt in per target. The dump streams through sha256sum straight into age: never written in plaintext, no plaintext fallback, only public keys in the config.

Secrets out of the config

Passwords come from a 0600 file or the environment into the command's env — not in vault.json, not in ps, redacted from errors.

Dashboard in the same binary

serve renders HTML that works with zero JavaScript, enhanced by a wasm client: "Backup now" per target, plus /api/list, /guide, /llms.txt.

What it backs up

Add "container": "pg" to run the dump inside docker exec.

kindhowrestore
filersync a path (local or host:/path)rsync back
postgrespg_dump | gzip (optionally over ssh)gunzip | psql
mysqlmysqldump | gzip (optionally over ssh)gunzip | mysql
mongomongodump --archive --gzipmongorestore --archive --drop
customany shell command that writes the artifactany shell command that reads it

Encrypt one target

Other targets are untouched. Decrypt with --identity <file> or MACHIN_VAULT_AGE_IDENTITY at restore time.

{ "name": "secrets-db", "kind": "custom", "command": "...", "ext": "tar.gz",
  "encrypt": "age", "age_recipients": ["age1primary...", "age1breakglass..."],
  "secrets": [{ "env": "MV_PW", "from": "file:/etc/machin-vault/secrets/db" }] }

Quickstart

curl -fsSL https://github.com/javimosch/machin-vault/releases/latest/download/machin-vault-linux-x86_64 -o machin-vault
chmod +x machin-vault
cp vault.json.example vault.json          # edit your targets
./machin-vault -c vault.json backup       # back up everything now
./machin-vault -c vault.json list         # see what you have
./machin-vault guide --human              # the full operator manual

Stateless: a plain cron line machin-vault -c /etc/vault.json backup is enough. Telemetry is one anonymous event per run (never contents, names, paths or credentials); DO_NOT_TRACK=1 turns it off.

Limits — read before trusting it