cron
管理定时任务。
使用方法
bash
openclaw cron [command]可用命令
| 命令 | 描述 |
|---|---|
list | 列出所有定时任务 |
add | 添加定时任务 |
remove | 删除定时任务 |
enable | 启用定时任务 |
disable | 禁用定时任务 |
添加定时任务
bash
# 每天早上 9 点执行
openclaw cron add "0 9 * * *" "openclaw status"
# 每小时执行
openclaw cron add "0 * * * *" "openclaw health"
# 自定义任务
openclaw cron add "*/30 * * * *" "/path/to/script.sh"时间格式
| 格式 | 描述 | 示例 |
|---|---|---|
* * * * * | 分 时 日 月 周 | 0 9 * * 1-5 |
@hourly | 每小时 | @hourly |
@daily | 每天 | @daily |
@weekly | 每周 | @weekly |