Enterprise Backup v3 — Self-Discovering Architecture
Core Design
Enterprise backup upgraded from whitelist-based (v2) to fully self-discovering (v3). Zero manual updates needed when VPS evolves.
Auto-Discovery Mechanisms
- Workspaces:
~/*/CLAUDE.mdor~/*/. claude/→ auto-captured - Project memories:
~/.claude/projects/*/memory/wildcard loop - Databases: All containers matching
postgres|pgvector|timescale|postgisimage patterns → auto-dumped - .env files:
find /opt -maxdepth 3 -name '.env'→ auto-templated + encrypted - Drift detector: Any new
/opt/*/dir not in known categories → auto-captured todiscovered/+ flagged in commit
Key Gotchas (from build session)
.gitignoreblanketdata/silently blocks Pythonsrc/*/data/packages — use targeted exclusions- Docker
--filter ancestor=postgresmisses derivative images (pgvector, timescale) — grep image column instead psql -U userfails without-d dbnameif user’s default DB doesn’t exist — try system DBs first- SSH key auth (
GIT_SSH_COMMAND) works across all repos; PAT may be repo-scoped tar czf dir/out.tar.gz -C dir/ .self-includes — write to mktemp first
Files
- Script:
/opt/enterprise-backup/sync.sh - Repo:
ARJ999/enterprise-backup(private) - Cron:
30 18 * * *(midnight IST) in root crontab - Encryption key:
/opt/enterprise-backup/.backup-key(AES-256-CBC)