Settings that were silently lost on reinstall: - Track .smallclaw/heartbeat/config.json (active hours 8-22, interval 30m) - Track .smallclaw/skills_state.json (multi-agent-orchestrator enabled) - Fix gitignore: heartbeat/ → heartbeat/runs/ (only ignore run logs, not config) - Fix gitignore: remove skills_state.json from ignored list Vault (contains channel tokens, passwords) cannot go in git — instead: - Add scripts/backup-vault.sh: backs up vault+credentials to ~/.smallclaw-backup/ keeping last 5 snapshots. Run manually or via cron (0 3 * * *). - Run initial backup now → ~/.smallclaw-backup/vault_20260518_232441 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
29 lines
983 B
Bash
Executable File
29 lines
983 B
Bash
Executable File
#!/bin/bash
|
|
# Backup SmallClaw vault and critical settings to ~/.smallclaw-backup/
|
|
# Run manually or add to cron: 0 3 * * * bash ~/homeclaw/scripts/backup-vault.sh
|
|
|
|
set -e
|
|
|
|
REPO_DIR="$(cd "$(dirname "$0")/.." && pwd)"
|
|
BACKUP_DIR="$HOME/.smallclaw-backup"
|
|
DATE="$(date +%Y%m%d_%H%M%S)"
|
|
|
|
mkdir -p "$BACKUP_DIR"
|
|
|
|
# vault (암호화된 파일 — 비밀번호/토큰 포함)
|
|
if [ -d "$REPO_DIR/.smallclaw/vault" ]; then
|
|
cp -r "$REPO_DIR/.smallclaw/vault" "$BACKUP_DIR/vault_$DATE"
|
|
# 최근 5개만 보관
|
|
ls -dt "$BACKUP_DIR"/vault_* 2>/dev/null | tail -n +6 | xargs rm -rf 2>/dev/null || true
|
|
echo "✓ vault → $BACKUP_DIR/vault_$DATE"
|
|
fi
|
|
|
|
# credentials
|
|
if [ -d "$REPO_DIR/.smallclaw/credentials" ]; then
|
|
cp -r "$REPO_DIR/.smallclaw/credentials" "$BACKUP_DIR/credentials_$DATE"
|
|
ls -dt "$BACKUP_DIR"/credentials_* 2>/dev/null | tail -n +6 | xargs rm -rf 2>/dev/null || true
|
|
echo "✓ credentials → $BACKUP_DIR/credentials_$DATE"
|
|
fi
|
|
|
|
echo "Backup complete: $BACKUP_DIR"
|