[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7588NNZCT5DXY9C3TH9KHNX":3,"skill-same:01M7588NNZCT5DXY9C3TH9KHNX":66},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":37,"commitSha":38,"skillDirectory":39,"forksCount":40,"repositoryHtmlUrl":41,"repositoryHomepageUrl":42,"ownerHtmlUrl":43,"ownerBlogUrl":6,"ownerDescription":44,"updatedAt":45,"install":46,"resources":59},"01M7588NNZCT5DXY9C3TH9KHNX","hermes-backup",null,"Use when performing a full-system backup of a Hermes Agent server — survey, clean up caches, checkpoint databases, bundle repos and configs, compress, and write a manifest. Pairs with hermes-recovery for the restore side.","lukemcqueen\u002Fsteadfaste-fleet","lukemcqueen","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F405240?v=4","01M757MHPAGRXTJAT46SKZP98R","Luke McQueen","01M757MHPZ573KP8DT9GB8SBQ7",4,"MIT","https:\u002F\u002Fgithub.com\u002Flukemcqueen\u002Fsteadfaste-fleet\u002Fblob\u002Fmain\u002Fskills\u002Fdevops\u002Fhermes-backup\u002FSKILL.md",[],[],"2026-11-12 13:55:43",false,"---\nname: hermes-backup\ndescription: \"Use when performing a full-system backup of a Hermes Agent server — survey, clean up caches, checkpoint databases, bundle repos and configs, compress, and write a manifest. Pairs with hermes-recovery for the restore side.\"\nversion: 1.0.0\nauthor: Steadfaste Fleet\nlicense: MIT\nmetadata:\n  hermes:\n    tags: [backup, maintenance, devops, hermes, recovery]\n    related_skills: [hermes-recovery, weekly-auto-fix]\n---\n\n# Hermes Agent Full-System Backup\n\nSystematic procedure to create a complete, verifiable backup of a Hermes Agent server. Covers repo bundles, session databases, knowledge stores (mycortex PGlite), Hermes configuration (skills\u002Fscripts\u002Fplugins\u002Fcron), brain sources, langfuse stack config, docker image archives, nginx config, shell config, and credentials.\n\n## When to Use\n\n- **Full-system backup** — user asks \"backup everything\" or \"backup the server\"\n- **Pre-migration snapshot** — before a server move, OS upgrade, or hardware swap\n- **Disaster recovery prep** — create a restore point for use with `hermes-recovery`\n- **Periodic maintenance** — scheduled weekly\u002Fmonthly full backup\n\n**Don't use for:** single-file backups, git-only backups (use `git bundle` directly), database-only dumps (use sqlite3\u002Fpg_dump directly).\n\n## Workflow Order\n\nAlways run in this sequence — later steps depend on earlier data:\n\n### 1. Survey\n\nStart by understanding the terrain. Run these checks and log the results:\n\n```\ndf -h \u002F\ndu -sh ~\u002F* ~\u002F.[!.]* 2>\u002Fdev\u002Fnull | sort -rh | head -30\ndu -sh ~\u002F.hermes\u002F\nls -la ~\u002F.hermes\u002Fstate.db ~\u002F.hermes\u002Fkanban.db ~\u002F.hermes\u002Fweb-cache\u002Fcache.db\nls ~\u002F.hermes\u002F*.json ~\u002F.hermes\u002F*.yaml 2>\u002Fdev\u002Fnull\nfor repo in ~\u002Fsteadfaste-fleet ~\u002F.hermes\u002Fhermes-agent; do\n  if [ -d \"$repo\" ]; then\n    git -C $repo log --oneline -1 2>\u002Fdev\u002Fnull\n    git -C $repo gc --auto 2>\u002Fdev\u002Fnull\n  fi\ndone\ndocker ps --format \"{{.Names}} {{.Status}}\" 2>\u002Fdev\u002Fnull\ndu -sh ~\u002Fbrain\u002F ~\u002F.brain\u002F ~\u002F.legacy-brain\u002F ~\u002Flangfuse\u002F 2>\u002Fdev\u002Fnull\n```\n\n**Completion criteria:** You have a tree of what exists and its sizes.\n\n### 2. Pre-Backup Cleanup\n\nRemove package manager caches, browser binaries, and build artifacts. These are re-downloadable and inflate backup size.\n\n**Safe to remove:**\n- `~\u002F.npm\u002F_cacache` — npm cache\n- `~\u002F.bun\u002Finstall\u002Fcache` — bun install cache\n- `~\u002F.cache\u002Fms-playwright` — Playwright browser binaries (646 MB typical)\n- `~\u002F.cache\u002Felectron` — Electron cache\n- `~\u002F.cache\u002Fmozilla` — Firefox cache\n- `~\u002F.cache\u002Fnode-gyp` — C++ build artifacts\n- `~\u002F.cache\u002Fpip` — pip download cache\n- `~\u002F.cache\u002Fuv` — uv package cache\n- `~\u002F.cache\u002FHomebrew` — Homebrew download cache\n- `~\u002F.zcompdump*` — zsh completions\n\n```bash\nrm -rf ~\u002F.npm\u002F_cacache ~\u002F.bun\u002Finstall\u002Fcache\nrm -rf ~\u002F.cache\u002Fms-playwright ~\u002F.cache\u002Felectron ~\u002F.cache\u002Fmozilla\nrm -rf ~\u002F.cache\u002Fnode-gyp ~\u002F.cache\u002Fpip ~\u002F.cache\u002Fuv ~\u002F.cache\u002FHomebrew\nrm -f ~\u002F.zcompdump*\n```\n\n**Do NOT remove:**\n- `~\u002F.hermes\u002F` — Hermes runtime, skills, cron, sessions, config\n- `~\u002F.ollama\u002F` — LLM models\n- `~\u002F.local\u002F` — installed packages and binaries\n- `~\u002F.config\u002F` — system configs\n- `~\u002F.legacy-brain\u002F` — knowledge graph database\n- `~\u002Fbrain\u002F`, `~\u002F.brain\u002F` — knowledge sources\n- `~\u002Flangfuse\u002F` — Langfuse stack config\n- `~\u002Fsteadfaste-fleet*` — git repos\n\n**Skip from backup (re-downloadable):**\n- Ollama models (~262 MB for nomic-embed-text) — `ollama pull` restores\n- Python packages at `~\u002F.local\u002Flib\u002F` (~2.1 GB) — restorable via pip\u002Fuv\n- Hermes Agent node_modules + venv (~2.4 GB) — reconstructed from git bundle\n- Langfuse Docker volumes — Postgres\u002FClickHouse data (live containers)\n\n**Completion criteria:** At least 500 MB reclaimed. Report space saved.\n\n### 3. Checkpoint SQLite Databases\n\nFlush WAL files for consistent DB copies:\n\n```bash\nsqlite3 ~\u002F.hermes\u002Fstate.db \"PRAGMA wal_checkpoint(TRUNCATE);\"\nsqlite3 ~\u002F.hermes\u002Fkanban.db \"PRAGMA wal_checkpoint(TRUNCATE);\"\nsqlite3 ~\u002F.hermes\u002Fweb-cache\u002Fcache.db \"PRAGMA wal_checkpoint(TRUNCATE);\"\n```\n\n**Completion criteria:** `state.db-wal` and `state.db-shm` are 0 bytes or gone.\n\n### 4. Create Backup Directory\n\n```bash\nBACKUP_DATE=$(date +%Y-%m-%d)\nmkdir -p ~\u002Fbackups\u002F$BACKUP_DATE\u002F{databases,configs,brain,langfuse,docker-images,repos}\n```\n\n### 5. Bundle Git Repositories\n\nUse `git bundle` for portable full-repo snapshots (all branches, all tags):\n\n```bash\ncd ~\u002Fsteadfaste-fleet && git bundle create ~\u002Fbackups\u002F$BACKUP_DATE\u002Frepos\u002Fsteadfaste-fleet-public.bundle --all\n# ~\u002Fsteadfaste-fleet-private no longer a git repo — backup via cp -r ~\u002Fsteadfaste-fleet-private ~\u002Fbackups\u002F$BACKUP_DATE\u002Fprivate-data\u002F\ncd ~\u002F.hermes\u002Fhermes-agent && git bundle create ~\u002Fbackups\u002F$BACKUP_DATE\u002Frepos\u002Fhermes-agent.bundle --all\n```\n\n**Do NOT back up** `node_modules\u002F`, `venv\u002F`, or build artifacts — the bundle captures only git-tracked objects. The full checkout is reconstructed from the bundle.\n\n**Restore:** `git clone hermes-*.bundle \u003Cdirname>`\n\n**Completion criteria:** All bundle files exist and have non-zero size.\n\n### 6. Copy Databases\n\n```bash\ncp ~\u002F.hermes\u002Fstate.db ~\u002Fbackups\u002F$BACKUP_DATE\u002Fdatabases\u002F\ncp ~\u002F.hermes\u002Fkanban.db ~\u002Fbackups\u002F$BACKUP_DATE\u002Fdatabases\u002F\ncp ~\u002F.hermes\u002Fweb-cache\u002Fcache.db ~\u002Fbackups\u002F$BACKUP_DATE\u002Fdatabases\u002F\n```\n\n**mycortex PGlite** — PostgreSQL data directory, copy the full tree:\n\n```bash\nmkdir -p ~\u002Fbackups\u002F$BACKUP_DATE\u002Fdatabases\u002Fmycortex\ncp -a ~\u002F.legacy-brain\u002Fbrain.pglite ~\u002Fbackups\u002F$BACKUP_DATE\u002Fdatabases\u002Fmycortex\u002F\ncp ~\u002F.legacy-brain\u002Fpreferences.json ~\u002Fbackups\u002F$BACKUP_DATE\u002Fdatabases\u002Fmycortex\u002F\ncp ~\u002F.legacy-brain\u002Fconfig.json ~\u002Fbackups\u002F$BACKUP_DATE\u002Fdatabases\u002Fmycortex\u002F\n```\n\n**Completion criteria:** All DB files in place matching original sizes.\n\n### 7. Copy Hermes Configuration\n\nCore config:\n```bash\ncp ~\u002F.hermes\u002Fconfig.yaml ~\u002Fbackups\u002F$BACKUP_DATE\u002Fconfigs\u002F\ncp -a ~\u002F.hermes\u002Fskills ~\u002Fbackups\u002F$BACKUP_DATE\u002Fconfigs\u002F\ncp -a ~\u002F.hermes\u002Fscripts ~\u002Fbackups\u002F$BACKUP_DATE\u002Fconfigs\u002F\ncp -a ~\u002F.hermes\u002Fplugins ~\u002Fbackups\u002F$BACKUP_DATE\u002Fconfigs\u002F 2>\u002Fdev\u002Fnull\ncp -a ~\u002F.hermes\u002Fcron ~\u002Fbackups\u002F$BACKUP_DATE\u002Fconfigs\u002F\n```\n\nRoot-level JSON state files:\n```bash\nmkdir -p ~\u002Fbackups\u002F$BACKUP_DATE\u002Fconfigs\u002Fhermes-root\nfor f in auth.json gateway_state.json channel_directory.json \\\n         docker-daemon.json processes.json \\\n         provider_models_cache.json ollama_cloud_models_cache.json; do\n  cp ~\u002F.hermes\u002F$f ~\u002Fbackups\u002F$BACKUP_DATE\u002Fconfigs\u002Fhermes-root\u002F 2>\u002Fdev\u002Fnull\ndone\ncp ~\u002F.hermes\u002Fmodels_dev_cache.json ~\u002Fbackups\u002F$BACKUP_DATE\u002Fconfigs\u002F 2>\u002Fdev\u002Fnull\n```\n\nHermes subdirectories (dashboard, LSP, offline scripts):\n```bash\nmkdir -p ~\u002Fbackups\u002F$BACKUP_DATE\u002Fconfigs\u002Fhermes-subdirs\ncp -a ~\u002F.hermes\u002Fdashboard ~\u002Fbackups\u002F$BACKUP_DATE\u002Fconfigs\u002Fhermes-subdirs\u002F 2>\u002Fdev\u002Fnull\ncp -a ~\u002F.hermes\u002Flsp ~\u002Fbackups\u002F$BACKUP_DATE\u002Fconfigs\u002Fhermes-subdirs\u002F 2>\u002Fdev\u002Fnull\ncp -a ~\u002F.hermes\u002Foffline ~\u002Fbackups\u002F$BACKUP_DATE\u002Fconfigs\u002Fhermes-subdirs\u002F 2>\u002Fdev\u002Fnull\n```\n\nSystem configs:\n```bash\ncp -a ~\u002F.hermes\u002Fcache ~\u002Fbackups\u002F$BACKUP_DATE\u002Fconfigs\u002F 2>\u002Fdev\u002Fnull\ncp -a ~\u002F.hermes\u002Fbin ~\u002Fbackups\u002F$BACKUP_DATE\u002Fconfigs\u002F 2>\u002Fdev\u002Fnull\ncp ~\u002F.zshrc ~\u002Fbackups\u002F$BACKUP_DATE\u002Fconfigs\u002F.zshrc\ncrontab -l > ~\u002Fbackups\u002F$BACKUP_DATE\u002Fconfigs\u002Fcrontab.txt 2>\u002Fdev\u002Fnull\ncp ~\u002F.git-credentials ~\u002Fbackups\u002F$BACKUP_DATE\u002Fconfigs\u002F 2>\u002Fdev\u002Fnull\n```\n\nNginx config (try without sudo first):\n```bash\ncp \u002Fetc\u002Fnginx\u002Fsites-enabled\u002Fhermes-services.conf ~\u002Fbackups\u002F$BACKUP_DATE\u002Fconfigs\u002Fnginx-hermes-services.conf 2>\u002Fdev\u002Fnull\n```\n\n**Completion criteria:** Every config directory has files matching the source.\n\n### 8. Copy Brain and Knowledge Data\n\n```bash\ncp -a ~\u002Fbrain ~\u002Fbackups\u002F$BACKUP_DATE\u002Fbrain\u002Fbrain\ncp -a ~\u002F.brain ~\u002Fbackups\u002F$BACKUP_DATE\u002Fbrain\u002Fdot-brain\n```\n\n**Completion criteria:** Both brain dirs present at expected sizes.\n\n### 9. Copy Langfuse and Docker Images\n\n```bash\nmkdir -p ~\u002Fbackups\u002F$BACKUP_DATE\u002Flangfuse ~\u002Fbackups\u002F$BACKUP_DATE\u002Fdocker-images\ncp ~\u002Flangfuse\u002Fdocker-compose.yml ~\u002Fbackups\u002F$BACKUP_DATE\u002Flangfuse\u002F\ncp ~\u002Flangfuse\u002F.env ~\u002Fbackups\u002F$BACKUP_DATE\u002Flangfuse\u002F\ncp ~\u002F.hermes\u002Fdocker-*.tar.gz ~\u002Fbackups\u002F$BACKUP_DATE\u002Fdocker-images\u002F 2>\u002Fdev\u002Fnull\n```\n\n**Completion criteria:** Langfuse configs and any docker image archives present.\n\n### 10. Write Manifest\n\nCreate `MANIFEST.txt` inside the backup directory. Include:\n- Date, hostname\n- Category breakdown with file counts and sizes\n- What was cleaned up (space reclaimed)\n- What was intentionally skipped (Ollama models, Python packages, docker volumes)\n- How to restore\n\n**Completion criteria:** MANIFEST.txt exists, all backup files accounted for.\n\n### 11. Compress the Archive\n\n```bash\ncd ~\u002Fbackups\ntar czf $BACKUP_DATE-hermes-backup.tar.gz $BACKUP_DATE\u002F\n```\n\nVerify: `tar tzf $BACKUP_DATE-hermes-backup.tar.gz | head -5`\n\nLog compression ratio (raw vs compressed size).\n\n### 12. Record in Memory\n\nSave the backup date, archive path, and size to memory so future sessions can find it.\n\n**Completion criteria:** Memory updated with backup location.\n\n## Pitfalls\n\n| Pitfall | Symptom | Fix |\n|---------|---------|-----|\n| **state.db copied while gateway is writing** | WAL not flushed, partial write | Checkpoint first (`PRAGMA wal_checkpoint(TRUNCATE)`), then copy. **Better: use the sqlite backup API for a WAL-correct consistent snapshot of a LIVE db** — `python3 -c \"import sqlite3; src=sqlite3.connect('~\u002F.hermes\u002Fstate.db'); dst=sqlite3.connect('backup.db'); src.backup(dst)\"` — handles WAL without stopping the gateway |\n| **git bundle fails: packed object corrupt** | `fatal: packed object ... is corrupt` \u002F `pack has bad object at offset` from `git bundle create --all` | The repo's `.git` packs are damaged (disk write errors). HEAD commit may still be intact in another pack (`git cat-file -t HEAD` works, `git log` works). Fallback: tar the worktree (the RUNNING code, no .git\u002Fvenv\u002Fnode_modules) + tar `.git` raw as `hermes-agent-gitdir.tar.gz`. Repair later: remove bad packs (`git verify-pack` to find them) + `git fetch origin` (works if repo is ≤1 commit behind origin) |\n| **git bundle from dirty working tree** | Uncommitted changes excluded from bundle | `git status --short` first — report dirty state; bundle anyway for now |\n| **~\u002F.git-credentials zeroed by gateway write protection** | File exists but 0 bytes | Check with `wc -c` after copy; re-populate if zeroed |\n| **Nginx config permission denied** | Can't read `\u002Fetc\u002Fnginx\u002Fsites-enabled\u002F*` | Try without sudo; if blocked, skip and note in manifest |\n| **mycortex PGlite has lock files** | Copy errors on `.mycortex-lock\u002Flock` | Skip lock files — they're recreated on restart |\n| **Multiple backup dirs same day** | Previous backup at same date path | Use `$BACKUP_DATE-v2` suffix |\n| **Docker images NOT pre-exported** | No `~\u002F.hermes\u002Fdocker-*.tar.gz` | Skip step; note in manifest that images must pull from registry |\n| **Backup archive too large for disk** | `df -h` shows \u003C 1 GB free | Survey first; skip re-downloadable items aggressively |\n\n## Verification Checklist\n\n- [ ] Survey complete — disk space, repo state, docker status all known\n- [ ] Cleanup freed ≥ 500 MB (or justified as minimal)\n- [ ] SQLite databases checkpointed (WAL files zeroed)\n- [ ] All 3 git repos bundled (public, private, hermes-agent)\n- [ ] state.db, kanban.db, web-cache.db, mycortex PGlite all copied\n- [ ] config.yaml, skills\u002F, scripts\u002F, cron\u002F, plugins\u002F all backed up\n- [ ] Root JSON files (auth, gateway, channel, processes, caches) backed up\n- [ ] Hermes subdirs (dashboard, LSP, offline) backed up\n- [ ] ~\u002Fbrain\u002F and ~\u002F.brain\u002F both copied\n- [ ] nginx config copied (or skipped with reason in manifest)\n- [ ] .zshrc, crontab.txt, .git-credentials backed up\n- [ ] Langfuse config copied\n- [ ] Docker image archives copied (or noted absent)\n- [ ] MANIFEST.txt written — covers all included and excluded items\n- [ ] Archive compressed — verified with `tar tzf`\n- [ ] Final archive size ≤ 1 GB (or justified larger)\n- [ ] Backup location recorded in memory for future recovery","# Hermes Agent Full-System Backup\n\nSystematic procedure to create a complete, verifiable backup of a Hermes Agent server. Covers repo bundles, session databases, knowledge stores (mycortex PGlite), Hermes configuration (skills\u002Fscripts\u002Fplugins\u002Fcron), brain sources, langfuse stack config, docker image archives, nginx config, shell config, and credentials.\n\n## When to Use\n\n- **Full-system backup** — user asks \"backup everything\" or \"backup the server\"\n- **Pre-migration snapshot** — before a server move, OS upgrade, or hardware swap\n- **Disaster recovery prep** — create a restore point for use with `hermes-recovery`\n- **Periodic maintenance** — scheduled weekly\u002Fmonthly full backup\n\n**Don't use for:** single-file backups, git-only backups (use `git bundle` directly), database-only dumps (use sqlite3\u002Fpg_dump directly).\n\n## Workflow Order\n\nAlways run in this sequence — later steps depend on earlier data:\n\n### 1. Survey\n\nStart by understanding the terrain. Run these checks and log the results:\n\n```\ndf -h \u002F\ndu -sh ~\u002F* ~\u002F.[!.]* 2>\u002Fdev\u002Fnull | sort -rh | head -30\ndu -sh ~\u002F.hermes\u002F\nls -la ~\u002F.hermes\u002Fstate.db ~\u002F.hermes\u002Fkanban.db ~\u002F.hermes\u002Fweb-cache\u002Fcache.db\nls ~\u002F.hermes\u002F*.json ~\u002F.hermes\u002F*.yaml 2>\u002Fdev\u002Fnull\nfor repo in ~\u002Fsteadfaste-fleet ~\u002F.hermes\u002Fhermes-agent; do\n  if [ -d \"$repo\" ]; then\n    git -C $repo log --oneline -1 2>\u002Fdev\u002Fnull\n    git -C $repo gc --auto 2>\u002Fdev\u002Fnull\n  fi\ndone\ndocker ps --format \"{{.Names}} {{.Status}}\" 2>\u002Fdev\u002Fnull\ndu -sh ~\u002Fbrain\u002F ~\u002F.brain\u002F ~\u002F.legacy-brain\u002F ~\u002Flangfuse\u002F 2>\u002Fdev\u002Fnull\n```\n\n**Completion criteria:** You have a tree of what exists and its sizes.\n\n### 2. Pre-Backup Cleanup\n\nRemove package manager caches, browser binaries, and build artifacts. These are re-downloadable and inflate backup size.\n\n**Safe to remove:**\n- `~\u002F.npm\u002F_cacache` — npm cache\n- `~\u002F.bun\u002Finstall\u002Fcache` — bun install cache\n- `~\u002F.cache\u002Fms-playwright` — Playwright browser binaries (646 MB typical)\n- `~\u002F.cache\u002Felectron` — Electron cache\n- `~\u002F.cache\u002Fmozilla` — Firefox cache\n- `~\u002F.cache\u002Fnode-gyp` — C++ build artifacts\n- `~\u002F.cache\u002Fpip` — pip download cache\n- `~\u002F.cache\u002Fuv` — uv package cache\n- `~\u002F.cache\u002FHomebrew` — Homebrew download cache\n- `~\u002F.zcompdump*` — zsh completions\n\n```bash\nrm -rf ~\u002F.npm\u002F_cacache ~\u002F.bun\u002Finstall\u002Fcache\nrm -rf ~\u002F.cache\u002Fms-playwright ~\u002F.cache\u002Felectron ~\u002F.cache\u002Fmozilla\nrm -rf ~\u002F.cache\u002Fnode-gyp ~\u002F.cache\u002Fpip ~\u002F.cache\u002Fuv ~\u002F.cache\u002FHomebrew\nrm -f ~\u002F.zcompdump*\n```\n\n**Do NOT remove:**\n- `~\u002F.hermes\u002F` — Hermes runtime, skills, cron, sessions, config\n- `~\u002F.ollama\u002F` — LLM models\n- `~\u002F.local\u002F` — installed packages and binaries\n- `~\u002F.config\u002F` — system configs\n- `~\u002F.legacy-brain\u002F` — knowledge graph database\n- `~\u002Fbrain\u002F`, `~\u002F.brain\u002F` — knowledge sources\n- `~\u002Flangfuse\u002F` — Langfuse stack config\n- `~\u002Fsteadfaste-fleet*` — git repos\n\n**Skip from backup (re-downloadable):**\n- Ollama models (~262 MB for nomic-embed-text) — `ollama pull` restores\n- Python packages at `~\u002F.local\u002Flib\u002F` (~2.1 GB) — restorable via pip\u002Fuv\n- Hermes Agent node_modules + venv (~2.4 GB) — reconstructed from git bundle\n- Langfuse Docker volumes — Postgres\u002FClickHouse data (live containers)\n\n**Completion criteria:** At least 500 MB reclaimed. Report space saved.\n\n### 3. Checkpoint SQLite Databases\n\nFlush WAL files for consistent DB copies:\n\n```bash\nsqlite3 ~\u002F.hermes\u002Fstate.db \"PRAGMA wal_checkpoint(TRUNCATE);\"\nsqlite3 ~\u002F.hermes\u002Fkanban.db \"PRAGMA wal_checkpoint(TRUNCATE);\"\nsqlite3 ~\u002F.hermes\u002Fweb-cache\u002Fcache.db \"PRAGMA wal_checkpoint(TRUNCATE);\"\n```\n\n**Completion criteria:** `state.db-wal` and `state.db-shm` are 0 bytes or gone.\n\n### 4. Create Backup Directory\n\n```bash\nBACKUP_DATE=$(date +%Y-%m-%d)\nmkdir -p ~\u002Fbackups\u002F$BACKUP_DATE\u002F{databases,configs,brain,langfuse,docker-images,repos}\n```\n\n### 5. Bundle Git Repositories\n\nUse `git bundle` for portable full-repo snapshots (all branches, all tags):\n\n```bash\ncd ~\u002Fsteadfaste-fleet && git bundle create ~\u002Fbackups\u002F$BACKUP_DATE\u002Frepos\u002Fsteadfaste-fleet-public.bundle --all\n# ~\u002Fsteadfaste-fleet-private no longer a git repo — backup via cp -r ~\u002Fsteadfaste-fleet-private ~\u002Fbackups\u002F$BACKUP_DATE\u002Fprivate-data\u002F\ncd ~\u002F.hermes\u002Fhermes-agent && git bundle create ~\u002Fbackups\u002F$BACKUP_DATE\u002Frepos\u002Fhermes-agent.bundle --all\n```\n\n**Do NOT back up** `node_modules\u002F`, `venv\u002F`, or build artifacts — the bundle captures only git-tracked objects. The full checkout is reconstructed from the bundle.\n\n**Restore:** `git clone hermes-*.bundle \u003Cdirname>`\n\n**Completion criteria:** All bundle files exist and have non-zero size.\n\n### 6. Copy Databases\n\n```bash\ncp ~\u002F.hermes\u002Fstate.db ~\u002Fbackups\u002F$BACKUP_DATE\u002Fdatabases\u002F\ncp ~\u002F.hermes\u002Fkanban.db ~\u002Fbackups\u002F$BACKUP_DATE\u002Fdatabases\u002F\ncp ~\u002F.hermes\u002Fweb-cache\u002Fcache.db ~\u002Fbackups\u002F$BACKUP_DATE\u002Fdatabases\u002F\n```\n\n**mycortex PGlite** — PostgreSQL data directory, copy the full tree:\n\n```bash\nmkdir -p ~\u002Fbackups\u002F$BACKUP_DATE\u002Fdatabases\u002Fmycortex\ncp -a ~\u002F.legacy-brain\u002Fbrain.pglite ~\u002Fbackups\u002F$BACKUP_DATE\u002Fdatabases\u002Fmycortex\u002F\ncp ~\u002F.legacy-brain\u002Fpreferences.json ~\u002Fbackups\u002F$BACKUP_DATE\u002Fdatabases\u002Fmycortex\u002F\ncp ~\u002F.legacy-brain\u002Fconfig.json ~\u002Fbackups\u002F$BACKUP_DATE\u002Fdatabases\u002Fmycortex\u002F\n```\n\n**Completion criteria:** All DB files in place matching original sizes.\n\n### 7. Copy Hermes Configuration\n\nCore config:\n```bash\ncp ~\u002F.hermes\u002Fconfig.yaml ~\u002Fbackups\u002F$BACKUP_DATE\u002Fconfigs\u002F\ncp -a ~\u002F.hermes\u002Fskills ~\u002Fbackups\u002F$BACKUP_DATE\u002Fconfigs\u002F\ncp -a ~\u002F.hermes\u002Fscripts ~\u002Fbackups\u002F$BACKUP_DATE\u002Fconfigs\u002F\ncp -a ~\u002F.hermes\u002Fplugins ~\u002Fbackups\u002F$BACKUP_DATE\u002Fconfigs\u002F 2>\u002Fdev\u002Fnull\ncp -a ~\u002F.hermes\u002Fcron ~\u002Fbackups\u002F$BACKUP_DATE\u002Fconfigs\u002F\n```\n\nRoot-level JSON state files:\n```bash\nmkdir -p ~\u002Fbackups\u002F$BACKUP_DATE\u002Fconfigs\u002Fhermes-root\nfor f in auth.json gateway_state.json channel_directory.json \\\n         docker-daemon.json processes.json \\\n         provider_models_cache.json ollama_cloud_models_cache.json; do\n  cp ~\u002F.hermes\u002F$f ~\u002Fbackups\u002F$BACKUP_DATE\u002Fconfigs\u002Fhermes-root\u002F 2>\u002Fdev\u002Fnull\ndone\ncp ~\u002F.hermes\u002Fmodels_dev_cache.json ~\u002Fbackups\u002F$BACKUP_DATE\u002Fconfigs\u002F 2>\u002Fdev\u002Fnull\n```\n\nHermes subdirectories (dashboard, LSP, offline scripts):\n```bash\nmkdir -p ~\u002Fbackups\u002F$BACKUP_DATE\u002Fconfigs\u002Fhermes-subdirs\ncp -a ~\u002F.hermes\u002Fdashboard ~\u002Fbackups\u002F$BACKUP_DATE\u002Fconfigs\u002Fhermes-subdirs\u002F 2>\u002Fdev\u002Fnull\ncp -a ~\u002F.hermes\u002Flsp ~\u002Fbackups\u002F$BACKUP_DATE\u002Fconfigs\u002Fhermes-subdirs\u002F 2>\u002Fdev\u002Fnull\ncp -a ~\u002F.hermes\u002Foffline ~\u002Fbackups\u002F$BACKUP_DATE\u002Fconfigs\u002Fhermes-subdirs\u002F 2>\u002Fdev\u002Fnull\n```\n\nSystem configs:\n```bash\ncp -a ~\u002F.hermes\u002Fcache ~\u002Fbackups\u002F$BACKUP_DATE\u002Fconfigs\u002F 2>\u002Fdev\u002Fnull\ncp -a ~\u002F.hermes\u002Fbin ~\u002Fbackups\u002F$BACKUP_DATE\u002Fconfigs\u002F 2>\u002Fdev\u002Fnull\ncp ~\u002F.zshrc ~\u002Fbackups\u002F$BACKUP_DATE\u002Fconfigs\u002F.zshrc\ncrontab -l > ~\u002Fbackups\u002F$BACKUP_DATE\u002Fconfigs\u002Fcrontab.txt 2>\u002Fdev\u002Fnull\ncp ~\u002F.git-credentials ~\u002Fbackups\u002F$BACKUP_DATE\u002Fconfigs\u002F 2>\u002Fdev\u002Fnull\n```\n\nNginx config (try without sudo first):\n```bash\ncp \u002Fetc\u002Fnginx\u002Fsites-enabled\u002Fhermes-services.conf ~\u002Fbackups\u002F$BACKUP_DATE\u002Fconfigs\u002Fnginx-hermes-services.conf 2>\u002Fdev\u002Fnull\n```\n\n**Completion criteria:** Every config directory has files matching the source.\n\n### 8. Copy Brain and Knowledge Data\n\n```bash\ncp -a ~\u002Fbrain ~\u002Fbackups\u002F$BACKUP_DATE\u002Fbrain\u002Fbrain\ncp -a ~\u002F.brain ~\u002Fbackups\u002F$BACKUP_DATE\u002Fbrain\u002Fdot-brain\n```\n\n**Completion criteria:** Both brain dirs present at expected sizes.\n\n### 9. Copy Langfuse and Docker Images\n\n```bash\nmkdir -p ~\u002Fbackups\u002F$BACKUP_DATE\u002Flangfuse ~\u002Fbackups\u002F$BACKUP_DATE\u002Fdocker-images\ncp ~\u002Flangfuse\u002Fdocker-compose.yml ~\u002Fbackups\u002F$BACKUP_DATE\u002Flangfuse\u002F\ncp ~\u002Flangfuse\u002F.env ~\u002Fbackups\u002F$BACKUP_DATE\u002Flangfuse\u002F\ncp ~\u002F.hermes\u002Fdocker-*.tar.gz ~\u002Fbackups\u002F$BACKUP_DATE\u002Fdocker-images\u002F 2>\u002Fdev\u002Fnull\n```\n\n**Completion criteria:** Langfuse configs and any docker image archives present.\n\n### 10. Write Manifest\n\nCreate `MANIFEST.txt` inside the backup directory. Include:\n- Date, hostname\n- Category breakdown with file counts and sizes\n- What was cleaned up (space reclaimed)\n- What was intentionally skipped (Ollama models, Python packages, docker volumes)\n- How to restore\n\n**Completion criteria:** MANIFEST.txt exists, all backup files accounted for.\n\n### 11. Compress the Archive\n\n```bash\ncd ~\u002Fbackups\ntar czf $BACKUP_DATE-hermes-backup.tar.gz $BACKUP_DATE\u002F\n```\n\nVerify: `tar tzf $BACKUP_DATE-hermes-backup.tar.gz | head -5`\n\nLog compression ratio (raw vs compressed size).\n\n### 12. Record in Memory\n\nSave the backup date, archive path, and size to memory so future sessions can find it.\n\n**Completion criteria:** Memory updated with backup location.\n\n## Pitfalls\n\n| Pitfall | Symptom | Fix |\n|---------|---------|-----|\n| **state.db copied while gateway is writing** | WAL not flushed, partial write | Checkpoint first (`PRAGMA wal_checkpoint(TRUNCATE)`), then copy. **Better: use the sqlite backup API for a WAL-correct consistent snapshot of a LIVE db** — `python3 -c \"import sqlite3; src=sqlite3.connect('~\u002F.hermes\u002Fstate.db'); dst=sqlite3.connect('backup.db'); src.backup(dst)\"` — handles WAL without stopping the gateway |\n| **git bundle fails: packed object corrupt** | `fatal: packed object ... is corrupt` \u002F `pack has bad object at offset` from `git bundle create --all` | The repo's `.git` packs are damaged (disk write errors). HEAD commit may still be intact in another pack (`git cat-file -t HEAD` works, `git log` works). Fallback: tar the worktree (the RUNNING code, no .git\u002Fvenv\u002Fnode_modules) + tar `.git` raw as `hermes-agent-gitdir.tar.gz`. Repair later: remove bad packs (`git verify-pack` to find them) + `git fetch origin` (works if repo is ≤1 commit behind origin) |\n| **git bundle from dirty working tree** | Uncommitted changes excluded from bundle | `git status --short` first — report dirty state; bundle anyway for now |\n| **~\u002F.git-credentials zeroed by gateway write protection** | File exists but 0 bytes | Check with `wc -c` after copy; re-populate if zeroed |\n| **Nginx config permission denied** | Can't read `\u002Fetc\u002Fnginx\u002Fsites-enabled\u002F*` | Try without sudo; if blocked, skip and note in manifest |\n| **mycortex PGlite has lock files** | Copy errors on `.mycortex-lock\u002Flock` | Skip lock files — they're recreated on restart |\n| **Multiple backup dirs same day** | Previous backup at same date path | Use `$BACKUP_DATE-v2` suffix |\n| **Docker images NOT pre-exported** | No `~\u002F.hermes\u002Fdocker-*.tar.gz` | Skip step; note in manifest that images must pull from registry |\n| **Backup archive too large for disk** | `df -h` shows \u003C 1 GB free | Survey first; skip re-downloadable items aggressively |\n\n## Verification Checklist\n\n- [ ] Survey complete — disk space, repo state, docker status all known\n- [ ] Cleanup freed ≥ 500 MB (or justified as minimal)\n- [ ] SQLite databases checkpointed (WAL files zeroed)\n- [ ] All 3 git repos bundled (public, private, hermes-agent)\n- [ ] state.db, kanban.db, web-cache.db, mycortex PGlite all copied\n- [ ] config.yaml, skills\u002F, scripts\u002F, cron\u002F, plugins\u002F all backed up\n- [ ] Root JSON files (auth, gateway, channel, processes, caches) backed up\n- [ ] Hermes subdirs (dashboard, LSP, offline) backed up\n- [ ] ~\u002Fbrain\u002F and ~\u002F.brain\u002F both copied\n- [ ] nginx config copied (or skipped with reason in manifest)\n- [ ] .zshrc, crontab.txt, .git-credentials backed up\n- [ ] Langfuse config copied\n- [ ] Docker image archives copied (or noted absent)\n- [ ] MANIFEST.txt written — covers all included and excluded items\n- [ ] Archive compressed — verified with `tar tzf`\n- [ ] Final archive size ≤ 1 GB (or justified larger)\n- [ ] Backup location recorded in memory for future recovery",{"name":5,"author":24,"license":15,"version":25,"metadata":26,"description":7},"Steadfaste Fleet","1.0.0",{"hermes":27},{"tags":28,"related_skills":34},[29,30,31,32,33],"backup","maintenance","devops","hermes","recovery",[35,36],"hermes-recovery","weekly-auto-fix","main","2e6aa8d15ab0a366c90be54f61bf9c6e97015e83","skills\u002Fdevops\u002Fhermes-backup",1,"https:\u002F\u002Fgithub.com\u002Flukemcqueen\u002Fsteadfaste-fleet","steadfaste.com","https:\u002F\u002Fgithub.com\u002Flukemcqueen","AI Architect | Building Hermes Cortex: governed multi-agent AI for autonomous software engineering | Enterprise Tech Consultant","2026-11-14 22:33:34",{"source":8,"skillName":5,"commands":47,"prompt":57,"zipAvailable":58},[48,51,54],{"tool":49,"command":50},"npx","npx skills add lukemcqueen\u002Fsteadfaste-fleet --skill hermes-backup",{"tool":52,"command":53},"bunx","bunx skills add lukemcqueen\u002Fsteadfaste-fleet --skill hermes-backup",{"tool":55,"command":56},"pnpm","pnpm dlx skills add lukemcqueen\u002Fsteadfaste-fleet --skill hermes-backup","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Flukemcqueen\u002Fsteadfaste-fleet\u002Fblob\u002Fmain\u002Fskills\u002Fdevops\u002Fhermes-backup\u002FSKILL.md",true,[60],{"path":61,"resourceType":62,"resourceTypeDesc":63,"sizeBytes":64,"sourceHtmlUrl":65},"references\u002Fworked-example-2026-06-22.md","REFERENCE","参考文档",2931,"https:\u002F\u002Fgithub.com\u002Flukemcqueen\u002Fsteadfaste-fleet\u002Fblob\u002Fmain\u002Fskills\u002Fdevops\u002Fhermes-backup\u002Freferences\u002Fworked-example-2026-06-22.md",[67,75,82,89,96,103],{"skillNo":68,"name":69,"nameZh":6,"description":70,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":71,"categories":72,"keywords":73,"publishedAt":74},"01M7DXY4G8NSVB59K8B6S2AQNP","macbook-linux-maintenance","Legacy MacBook Linux fixes: GPU wedge, reboot hang, thermal.","https:\u002F\u002Fgithub.com\u002Flukemcqueen\u002Fsteadfaste-fleet\u002Fblob\u002Fmain\u002Fskills\u002Fdevops\u002Fmacbook-linux-maintenance\u002FSKILL.md",[],[],"2026-11-15 14:19:17",{"skillNo":76,"name":77,"nameZh":6,"description":78,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":79,"categories":80,"keywords":81,"publishedAt":74},"01M7DXXYJCXFJ3TGB84ZQ8KFE6","governance-regression-triage","Triage a host's governance issues: what changed.","https:\u002F\u002Fgithub.com\u002Flukemcqueen\u002Fsteadfaste-fleet\u002Fblob\u002Fmain\u002Fskills\u002Fdevops\u002Fgovernance-regression-triage\u002FSKILL.md",[],[],{"skillNo":83,"name":84,"nameZh":6,"description":85,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":86,"categories":87,"keywords":88,"publishedAt":74},"01M7DXXSAP1G8FDRJAMXQGBBMK","enforcement-immutability","Use when enforcement files lose their immutable flag.","https:\u002F\u002Fgithub.com\u002Flukemcqueen\u002Fsteadfaste-fleet\u002Fblob\u002Fmain\u002Fskills\u002Fdevops\u002Fenforcement-immutability\u002FSKILL.md",[],[],{"skillNo":90,"name":91,"nameZh":6,"description":92,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":93,"categories":94,"keywords":95,"publishedAt":74},"01M78SSDQVRYX64Y16X32TC0NS","steadfaste-fleet-repo-deploy","Use when committing to the steadfaste-fleet repo.","https:\u002F\u002Fgithub.com\u002Flukemcqueen\u002Fsteadfaste-fleet\u002Fblob\u002Fmain\u002Fskills\u002Fdevops\u002Fsteadfaste-fleet-repo-deploy\u002FSKILL.md",[],[],{"skillNo":97,"name":98,"nameZh":6,"description":99,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":100,"categories":101,"keywords":102,"publishedAt":74},"01M78SS928F3R2RJAYVW4E30CE","steadfaste-fleet-maintenance","Maintain an installed Steadfaste Fleet instance — update both the upstream Hermes Agent and the fleet repo layer, merge diverged histories, sync skills safely, and troubleshoot common issues. Covers the dual-update workflow (hermes update + fleet-update.sh), encrypted brain data backup, mycortex import, and recovery techniques.","https:\u002F\u002Fgithub.com\u002Flukemcqueen\u002Fsteadfaste-fleet\u002Fblob\u002Fmain\u002Fskills\u002Fdevops\u002Fsteadfaste-fleet-maintenance\u002FSKILL.md",[],[],{"skillNo":104,"name":105,"nameZh":6,"description":106,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":107,"categories":108,"keywords":109,"publishedAt":74},"01M78SP1CHW0T0BWE5ZT6JBPX8","fleet-preflight","DEPRECATED alias — merged into survey-before-action (2026-08-20). Load survey-before-action instead; its \"Repo-Specific Pre-Flight\" section covers git search, Hermes boundary, and deployment verification.","https:\u002F\u002Fgithub.com\u002Flukemcqueen\u002Fsteadfaste-fleet\u002Fblob\u002Fmain\u002Fskills\u002Fdevops\u002Ffleet-preflight\u002FSKILL.md",[],[]]