test-repo/scripts
2026-02-26 16:52:12 -06:00
..
podcast-generator Add Tavily search tools and podcast generator scripts 2026-02-24 04:10:56 -06:00
security-monitors Signed-off-by: Matt Bruce <mbrucedogs@gmail.com> 2026-02-22 20:37:29 -06:00
audit-cli-coverage.sh Complete CLI sync rule implementation 2026-02-21 17:32:17 -06:00
create_ios_project.sh Clean up workspace scripts folder 2026-02-21 17:21:50 -06:00
daily-digest.sh Update daily-digest.sh with longer, more detailed article summaries 2026-02-26 16:52:12 -06:00
README.md Clean up workspace scripts folder 2026-02-21 17:21:50 -06:00
resource-monitor.sh Clean up workspace scripts folder 2026-02-21 17:21:50 -06:00
web-monitor.sh Signed-off-by: Matt Bruce <mbrucedogs@gmail.com> 2026-02-21 14:27:26 -06:00

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.sh
  • monitor_web_apps.sh → use web-monitor.sh
  • webapp-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