← 返回
未分类 中文

Cron Hardening

Guidelines for reliable OpenClaw cron jobs: model pinning, absolute paths, timeouts, delivery config, and error recovery.
可靠的 OpenClaw 定时任务指南:模型固定、绝对路径、超时设置、投递配置和错误恢复。
hohobohan
未分类 clawhub v1.0.0 1 版本 100000 Key: 无需
★ 0
Stars
📥 111
下载
💾 0
安装
1
版本
#latest

概述

Cron Hardening

Reliable cron config learned through repeated failures. Follow these rules for every new cron.

1. PIN the model

Every cron that delivers to the user must explicitly set a fast model. The global default can get stuck on model resolution (MiniMax cold-start especially).

"model": "deepseek/deepseek-v4-flash"

Time-sensitive crons that need pinning:

  • Expense check-ins (10am, 1:30pm, 10pm)
  • Expense sync (9:30am)
  • News briefings (7:30am, 3pm, 10pm)
  • Investment check-in (Sat 10am) and sync (Sat 11am)
  • Transport check-in (9am)

Non-time-sensitive crons (dashboard, backup, security audit) can use default model — delay is harmless.

2. Absolute paths only

Cron agentTurn payloads run in an isolated context. They cannot cd to the workspace first. Every command MUST use absolute paths.

WRONG:

cd /workspace && python3 scripts/sync.py

RIGHT:

/usr/bin/python3 /home/hobopi/.openclaw/workspace/scripts/sync-ledger-to-sheet.py

Preflight checks reject cd && python3 chains.

3. Timeouts

Cron typeTimeoutReason
----------------------------
Expense check-in300s (600s for 10pm)May wait for Hobo reply
News briefing600sWeb search + curation takes time
Expense sync60sQuick script, just needs to run
Investment sync600sReads all ledger files
Dashboard gen180sRuns 3 scripts in sequence
Token tracker300sHeavy usage data parsing
Transport check-in600sPrevious-day ask, may wait
Backup300star + gzip
Security audit600sFull healthcheck

4. Delivery config

For crons that deliver to Telegram, use explicit delivery:

"delivery": {
  "mode": "announce",
  "channel": "telegram",
  "to": "telegram:37134287"
}

mode: "none" for crons that don't need to notify the user (dashboard updates, token tracking).

5. Failure recovery

  • Check lastRunStatus and consecutiveErrors on cron status
  • lastDiagnostics shows the error phase: model-call-started = model resolution timeout
  • Common fixes: pin model, bump timeout, check absolute paths
  • After fixing, next scheduled run uses new config (no manual trigger needed)

6. maxConcurrentRuns

Set cron.maxConcurrentRuns in openclaw.json when multiple crons fire simultaneously:

"cron": { "maxConcurrentRuns": 2 }

Prevents Sunday 5am clash (security audit + hourly dashboard + expense check-in).

7. Failure alerts

"failureAlert": {
  "after": 2,
  "mode": "announce",
  "channel": "telegram",
  "to": "telegram:37134287"
}

Notifies Hobo after 2 consecutive failures. Default enabled.

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-06-04 14:09

安全检测

腾讯云安全 (Keen)

队列中

腾讯云安全 (Sanbu)

队列中

🔗 相关推荐

Sync Adapter

hohobohan
本地 .md 文件同步至 Google 表格,使用去重哈希,适用于支出、投资及任意键值数据。
★ 0 📥 137

Dashboard Generator

hohobohan
生成自包含的 HTML 仪表板,用于内存日志、费用图表和 token 使用情况,按 cron 每小时运行。
★ 0 📥 135

Inbox Manager

hohobohan
授权、读取、分类、归档、删除并汇总多个账户的 Gmail 收件箱。使用 Gmail API 和 OAuth。
★ 0 📥 140