| .. | ||
| backup.sh | ||
| qdrant_audit.py | ||
| README.md | ||
| restore_test.sh | ||
| t08_glitchtip_admin.sh | ||
ops/ — Server-side operations scripts
Scripts that run on netcup (not in the FastAPI container). Deploy via:
scp scripts/ops/backup.sh root@netcup:/root/scripts/backup.sh
scp scripts/ops/restore_test.sh root@netcup:/root/scripts/restore_test.sh
ssh netcup "chmod +x /root/scripts/*.sh"
backup.sh
Daily backup of all RMI data + system configs to /backups/<timestamp>/.
What it backs up:
- Postgres (
postgres.sql.gz) - Neo4j (
neo4j.dump) - Qdrant (
qdrant/<collection>/<snapshot>) - MinIO (
minio/) - GlitchTip Postgres (
glitchtip.sql.gz) - System configs (
etc_root.tar.gz) — DR-critical, ~19 MB, 2440 files:/etc/prometheus/— alert rules, prometheus.yml, alertmanager configs/root/scripts/— this backup script, restore_test, cron health check/root/.hermes/— Hermes gateway config (NOT sessions — too large)/root/.ssh/— SSH keys for git/auth/root/.bashrc,/root/.profile— shell config/root/backend/.env— backend secrets (gopass-backed in source)
- Old backups rotated (>7 days deleted)
- ntfy notification on success
Cadence: Runs via cron (daily, see crontab -l on netcup).
Restore test: /root/scripts/restore_test.sh spins up test Postgres on alt port 15432, restores, verifies table count ≥ 10, samples row counts, now also validates etc_root.tar.gz contains etc/prometheus/prometheus.yml.
restore_test.sh
Monthly restore-test cron (1st of month) that proves a backup can actually be restored, not just written.
What it checks:
- Postgres table count ≥ 10 (fail if too few)
- Row counts on
tokens,wallets,news_itemstables etc_root.tar.gzcontainsetc/prometheus/prometheus.ymletc_root.tar.gzfile count > 1000 (catches truncated backups)- Notifies via ntfy topic
rmi-criticalon failure,rmi-infoon success
Cron health check (cron_health_check.py)
Python watchdog that monitors cron job health and auto-restarts failed crons.
T10 (RMIV5) — Backup /etc + /root
Implemented in backup.sh step 6 (etc_root tarball). Verified 2026-06-22:
- Tarball: 19 MB, 2440 files
- Validates
etc/prometheus/prometheus.ymlexists - Excludes:
.cache,.ollama,.hermes/sessions,.cargo,.rustup - Restore test validates tarball contents before declaring success
Bug found and fixed 2026-06-22:
Original script tried to back up /etc/caddy/Caddyfile which does not exist on
netcup (we use nginx, not caddy). The validation silently passed because grep
returned nothing. Fixed to validate /etc/prometheus/prometheus.yml instead,
which actually exists and is the file we need for DR.