用于保障 OpenClaw 稳定运行的本地维护脚本(监控、重启、日志清理、网络代理健康检查)。
| 脚本 | 作用 | 运行方式 |
|---|---|---|
| ------ | ------ | ---------- |
gateway-watchdog.sh | Gateway 健康监控 | 每分钟/常驻 |
proxy-health.sh | 代理网络监控 | 每分钟 |
openclaw-safe-restart.sh | 安全重启 | 手动 |
cleanup-logs.sh | 日志清理 | 每天 |
log-cleanup-launchd.sh | macOS 定时清理 | LaunchAgent |
# 1. 复制环境变量示例
cp .env.example .env
# 2. 配置环境变量(至少设置 OPENCLAW_NOTIFY_TARGET)
vim .env
# 3. 运行安装脚本
bash install.sh
# 4. 运行自检
bash check.sh
# 通知目标(Telegram 用户 ID)
OPENCLAW_NOTIFY_TARGET=123456789
# Clash API(可选,用于代理切换)
CLASH_API=http://127.0.0.1:9090
CLASH_SECRET=your-secret
# 积压阈值(消息数)
QUEUE_THRESHOLD=100
openclaw CLIcurljq使用 LaunchAgent 定时/常驻运行:
launchctl load ~/Library/LaunchAgents/ai.openclaw.watchdog.plist
使用 systemd 或 cron:
sudo systemctl enable --now openclaw-watchdog
使用任务计划程序定时执行。
0.1.0 - 初始发布
共 1 个版本