| .. | ||
| podcast-generator | ||
| security-monitors | ||
| audit-cli-coverage.sh | ||
| create_ios_project.sh | ||
| README.md | ||
| resource-monitor.sh | ||
| web-monitor.sh | ||
Workspace Scripts
Cross-project utility scripts that don't belong in any single app.
Rule: App-specific CLI tools go IN THE PROJECT. These are only for cross-cutting concerns.
Scripts
web-monitor.sh
What: Monitors local web apps and auto-restarts if down
Runs: Via cron every 5 minutes
Monitors:
- Port 3000: gantt-board
- Port 3003: blog-backup
- Port 3005: heartbeat-monitor
Features:
- HTTP health checks (expects 200)
- Automatic process kill + restart
- Post-restart verification
- Lock file prevents concurrent runs
- Logs to:
memory/web-monitor.log
Usage:
# Manual run
./scripts/web-monitor.sh
# View logs
tail -f memory/web-monitor.log
daily-backup.sh
What: Commits data files from all web apps to Git
Runs: Daily via cron
Backs up:
- gantt-board/data/
- blog-backup/data/
- heartbeat-monitor/data/
Features:
- Only commits if data changed
- Auto-pushes to Gitea
- Logs to:
memory/backup.log
Usage:
./scripts/daily-backup.sh
resource-monitor.sh
What: Monitors system resources for running web apps
Runs: Manual (for debugging)
Monitors:
- CPU usage (>80% warns)
- Memory usage (>500MB warns)
- File descriptors (>900 warns)
- System free memory (<500MB warns)
Usage:
# Start monitoring in background
./scripts/resource-monitor.sh
# View logs
tail -f logs/process-monitor.log
# Stop
kill $(cat /tmp/process-monitor.pid)
create_ios_project.sh
What: Creates a new iOS SwiftUI project from Xcode template
Usage:
./scripts/create_ios_project.sh MyNewApp
Features:
- Uses Apple SwiftUI template
- Sets bundle ID to
com.mattbruce.<appname> - Sets deployment target to iOS 17.0
- Creates in
~/Documents/Projects/iPhone/OpenClaw/
Deprecated / Removed
The following were duplicates and have been deleted:
monitor-web-apps.sh→ use web-monitor.shmonitor_web_apps.sh→ use web-monitor.shwebapp-monitor.sh→ use web-monitor.sh
Cron Setup
These run automatically via cron. To check/edit:
crontab -e
Current entries:
*/5 * * * * cd /Users/mattbruce/.openclaw/workspace && ./scripts/web-monitor.sh
0 2 * * * cd /Users/mattbruce/.openclaw/workspace && ./scripts/daily-backup.sh