Compare commits

...

3 Commits

Author SHA1 Message Date
3dd382198d Sync 2026-04-14 15:25 2026-04-14 15:25:29 +09:00
b46bc8ef6a Merge remote-tracking branch 'origin/main' 2026-04-14 15:25:28 +09:00
f888bae907 Sync 2026-04-14 14:00 2026-04-14 14:00:35 +09:00
3 changed files with 30 additions and 1 deletions

View File

@@ -26,4 +26,33 @@ RackNerd VPS (New Year Special):
- Username: root - Username: root
- Root Password: Zg58Mb73C4ueHFYhq3 - Root Password: Zg58Mb73C4ueHFYhq3
- 已安装 hermes agent - 已安装 hermes agent
- 问题: Telegram 对话失联无响应 - 问题: Telegram 对话失联无响应
§
## Hermes Sync 架构 (2026-04-14 建成)
Gitea: https://d.momix.cc/Mixer/hermes-sync
三台机器:
- 本地 Linux (10-40-29-186): ~/.hermes-sync (symlink to ~/hermes-sync-tmp), ~/.hermes
- VPS RackNerd (soe219028): ~/.hermes-sync, ~/.hermes
- MacOS (MixdeMac-mini.local): /Users/moore/.hermes-sync, /Users/moore/.hermes
同步内容memories/MEMORY.md, skills/, state.db每机器一个 state_<hostname>.db
不同步config.yaml, .env, auth.json 等配置
sync.sh 已稳定217行无checkpoint直接copy到temp dir再处理避免SQLite WAL锁冲突
cron: 每2小时VPS和MacOS用绝对路径 /Users/moore/.hermes-sync/sync.sh
本地: 软链 ~/hermes-sync-tmp -> ~/hermes-sync
MacOS hostname: MixdeMac-mini.local
## macOS Hermes 路径
- 数据目录: /Users/moore/.hermes/state.db
- Hermes CLI: /Users/moore/.local/bin/hermes
- 无systemd用cron管理后台进程
## SQLite 多机同步关键经验
- WAL模式的db不能直接copy会损坏。用temp dir中转。
- 不能对WAL模式的db做checkpoint会造成malformed image直接shutil.copy2即可WAL会在下次连接时自动attach。
- merge时sessions用INSERT OR REPLACE去重messages用INSERT OR IGNORE避免重复插入
- 列数用PRAGMA table_info动态获取不硬编码

Binary file not shown.

Binary file not shown.