124 lines
2.8 KiB
Markdown
124 lines
2.8 KiB
Markdown
# Backup & Reset - Quick Reference
|
|
|
|
*Location: `~/.clawdbot/workspace/`*
|
|
|
|
---
|
|
|
|
## 🚨 **BEFORE RESET - MUST DO**
|
|
|
|
```bash
|
|
# 1. Run backup script
|
|
~/.clawdbot/workspace/backup_before_reset.sh
|
|
|
|
# 2. Copy to external storage
|
|
rsync -av ~/.clawdbot/workspace/backup-before-reset-* /Volumes/ExternalDrive/
|
|
|
|
# 3. Note the backup directory name (e.g., backup-before-reset-20260119-120000)
|
|
```
|
|
|
|
---
|
|
|
|
## ✅ **AFTER RESET - MUST DO**
|
|
|
|
```bash
|
|
# 1. Copy backup from external storage
|
|
rsync -av /Volumes/ExternalDrive/backup-before-reset-* ~/.clawdbot/workspace/
|
|
|
|
# 2. Run restore script
|
|
~/.clawdbot/workspace/restore_after_reset.sh ~/.clawdbot/workspace/backup-before-reset-YYYYMMDD-HHMMSS
|
|
|
|
# 3. Verify
|
|
crontab -l # Check 6 jobs
|
|
launchctl list | grep remix-sniper # Check service
|
|
psql -d remix_sniper -c '\l' # Check database
|
|
```
|
|
|
|
---
|
|
|
|
## 📋 **What's At Risk**
|
|
|
|
| Item | Impact | Backup? |
|
|
|------|--------|---------|
|
|
| Cron jobs (6) | Lost on reset | ✅ |
|
|
| Launchd service | Lost on reset | ✅ |
|
|
| PostgreSQL data | Lost on reset | ✅ |
|
|
| Tracking data (predictions, remixes) | May be lost | ✅ |
|
|
| Environment files (.env) | May be lost | ✅ |
|
|
|
|
---
|
|
|
|
## 🔍 **Verification**
|
|
|
|
```bash
|
|
# Cron jobs (should have 6)
|
|
crontab -l
|
|
|
|
# Launchd (should see remix-sniper)
|
|
launchctl list | grep remix-sniper
|
|
|
|
# Database (should have 4 tables)
|
|
psql -d remix_sniper -c "\dt"
|
|
|
|
# Tracking data (should have JSON files)
|
|
ls -la ~/.remix-sniper/tracking/
|
|
|
|
# Bot running
|
|
tail -f ~/projects/remix-sniper/bot.log
|
|
```
|
|
|
|
---
|
|
|
|
## 📁 **Backup Contents**
|
|
|
|
```
|
|
backup-before-reset-YYYYMMDD-HHMMSS/
|
|
├── crontab-backup.txt # All 6 cron jobs
|
|
├── launchd/
|
|
│ └── com.jakeshore.remix-sniper.plist
|
|
├── remix_sniper-db.sql # Full database dump
|
|
├── remix-sniper/
|
|
│ └── tracking/
|
|
│ ├── predictions.json
|
|
│ ├── remixes.json
|
|
│ └── snapshots/
|
|
├── env-files/
|
|
│ └── .env
|
|
├── clawdbot-workspace/ # All workspace files
|
|
├── scripts/
|
|
│ ├── pickle_motivation.sh
|
|
│ └── daily-anus-fact.sh
|
|
└── sha256-checksums.txt # File integrity
|
|
```
|
|
|
|
---
|
|
|
|
## ⚠️ **Troubleshooting**
|
|
|
|
### Cron jobs missing
|
|
```bash
|
|
crontab ~/.clawdbot/workspace/backup-before-reset-YYYYMMDD-HHMMSS/crontab-backup.txt
|
|
```
|
|
|
|
### Launchd not loading
|
|
```bash
|
|
launchctl load -w ~/Library/LaunchAgents/com.jakeshore.remix-sniper.plist
|
|
```
|
|
|
|
### PostgreSQL empty
|
|
```bash
|
|
brew services start postgresql@16
|
|
psql -d remix_sniper < ~/.clawdbot/workspace/backup-before-reset-YYYYMMDD-HHMMSS/remix_sniper-db.sql
|
|
```
|
|
|
|
---
|
|
|
|
## 📚 **Full Documentation**
|
|
|
|
`~/.clawdbot/workspace/RESET-IMPACT-ANALYSIS.md`
|
|
|
|
---
|
|
|
|
## 💛 **Need Help?**
|
|
|
|
Tag Buba in Discord if anything goes wrong during backup or restore.
|