add: backup snapshot script, update README with correct clone URL
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -53,3 +53,6 @@ models_dev_cache.json
|
||||
|
||||
# Backup files
|
||||
*.bak.*
|
||||
|
||||
# Git credentials
|
||||
.git-credentials
|
||||
@@ -27,7 +27,7 @@ curl -fsSL https://raw.githubusercontent.com/NousResearch/hermes-agent/main/scri
|
||||
# 2. Clone this repo over the top
|
||||
cd ~/.hermes
|
||||
git init
|
||||
git remote add origin http://192.168.68.145:3000/andy/hermes-config.git
|
||||
git remote add origin https://gitea.conlon.fun/andy/hermes-config.git
|
||||
git pull origin main
|
||||
|
||||
# 3. Restore secrets (from your safe backup)
|
||||
|
||||
27
scripts/snapshot_hermes_db.sh
Executable file
27
scripts/snapshot_hermes_db.sh
Executable file
@@ -0,0 +1,27 @@
|
||||
#!/bin/bash
|
||||
# Daily snapshot of Hermes SQLite databases for disaster recovery
|
||||
# Copies memory_store.db and state.db to ~/.hermes/backups/ with timestamps
|
||||
# Manages retention: keeps last 30 days
|
||||
|
||||
HERMES_HOME="${HERMES_HOME:-$HOME/.hermes}"
|
||||
BACKUP_DIR="$HERMES_HOME/backups"
|
||||
RETENTION_DAYS=30
|
||||
|
||||
mkdir -p "$BACKUP_DIR"
|
||||
|
||||
DATE=$(date +%Y%m%d_%H%M%S)
|
||||
|
||||
for db in memory_store.db state.db; do
|
||||
SRC="$HERMES_HOME/$db"
|
||||
if [ -f "$SRC" ]; then
|
||||
cp "$SRC" "$BACKUP_DIR/${db%.db}_${DATE}.db"
|
||||
echo "backed up $db"
|
||||
else
|
||||
echo "skipping $db (not found)"
|
||||
fi
|
||||
done
|
||||
|
||||
# Prune backups older than RETENTION_DAYS
|
||||
find "$BACKUP_DIR" -name '*.db' -type f -mtime +$RETENTION_DAYS -delete 2>/dev/null
|
||||
|
||||
echo "snapshot complete: $(date)"
|
||||
Reference in New Issue
Block a user