ai_member_xiaoban/skills/cron-schedule/SKILL.md
2026-03-18 08:00:08 +08:00

55 lines
2.5 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
name: cron-schedule
description: 定时任务/提醒设置支持一次性定时提醒和周期性cron任务。激活当用户提到"提醒我"、"定时"、"cron任务"、"多久之后通知我"等相关需求时。
---
# 定时任务设置Skill
用于快速创建定时提醒、周期性自动化任务。
## 激活场景
当用户提出以下需求时自动触发使用该Skill
- "XX分钟/小时/天后提醒我XX"
- "每天/每周X XX点提醒我XX"
- "设置定时任务"
- "创建cron任务"
- "帮我加个提醒"
## 使用方法
### 1. 一次性定时提醒(执行后自动删除)
**参数规则:**
- 延迟时间:支持"30分钟"、"2小时"、"1天"等自然语言时间
- 提醒内容:需要通知用户的具体消息
**示例:**
用户需求:"30分钟后提醒我开会"
执行命令:
```bash
openclaw cron add --at +30m --name "30分钟后开会提醒" --message "⏰ 提醒:时间到了,该去开会啦!" --announce --channel feishu --account xiaoban --to ou_d0474502fe89122e69d0e13123c7bb45 --tz Asia/Shanghai --delete-after-run
```
### 2. 周期性定时任务(重复执行)
**参数规则:**
- cron表达式标准cron格式 `分 时 日 月 周`,例如`0 8 * * *`表示每天8点
- 任务名称:便于识别的任务标识
- 执行内容/提醒消息:需要执行的操作或通知内容
**示例:**
用户需求:"每天早上8点提醒我备份数据"
执行命令:
```bash
openclaw cron add --cron "0 8 * * *" --name "每日8点数据备份提醒" --message "⏰ 每日提醒:请执行当日数据备份操作~" --announce --channel feishu --account xiaoban --to ou_d0474502fe89122e69d0e13123c7bb45 --tz Asia/Shanghai
```
## 强制规则(必须遵守)
1. 所有定时任务默认投递到用户飞书账号 `ou_d0474502fe89122e69d0e13123c7bb45`,不允许投递到其他地址
2. 时区强制指定为`Asia/Shanghai`,避免时间计算错误
3. 飞书投递必须加`--account xiaoban`参数指定使用xiaoban bot发送禁止使用默认default bot
4. 一次性提醒必须加`--delete-after-run`参数,执行后自动清理过期任务
5. 创建任务完成后需要将任务ID返回给用户方便后续管理
6. 不允许创建执行破坏性操作的定时任务
## 任务管理常用命令
- 查看所有定时任务:`openclaw cron list`
- 删除指定任务:`openclaw cron rm <任务ID>`
- 手动执行验证任务:`openclaw cron run <任务ID>`
- 查看任务执行状态:`openclaw cron status <任务ID>`