One self-hostable binary that backs up files and databases — and, when something is lost, lets an agent recover it in one glance.
# "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,...}]}]}
src/No daemon is needed to read a backup: it is just files named <target>_<unixtime>_<sha>.<ext>.
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.
pg_dump, mysqldump, mongodump, rsync or any shell command — over ssh or inside docker exec. It never reimplements them.
Content-addressed: an unchanged backup is skipped. Keep the newest N versions per target.
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.
Passwords come from a 0600 file or the environment into the command's env — not in vault.json, not in ps, redacted from errors.
serve renders HTML that works with zero JavaScript, enhanced by a wasm client: "Backup now" per target, plus /api/list, /guide, /llms.txt.
Add "container": "pg" to run the dump inside docker exec.
| kind | how | restore |
|---|---|---|
file | rsync a path (local or host:/path) | rsync back |
postgres | pg_dump | gzip (optionally over ssh) | gunzip | psql |
mysql | mysqldump | gzip (optionally over ssh) | gunzip | mysql |
mongo | mongodump --archive --gzip | mongorestore --archive --drop |
custom | any shell command that writes the artifact | any shell command that reads it |
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" }] }
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.
age on PATH.encrypt_password uses openssl aes-256-cbc, which is unauthenticated. Use per-target age instead.kind: file (rsync can't stream) — wrap it in a custom tar command.ps. Prefer a dump-only command on the DB host.serve reads vault.json once at startup: restart it after editing.