Xpersona
S

Scheduled Tasks | 定时任务

CLAWHUB · Unverified

Create and manage OpenClaw scheduled tasks (reminders, periodic notifications, automated workflows). 创建和管理 OpenClaw 定时任务(提醒、定时推送、自动化工作流)。 Supports OpenClaw C... Skill: Scheduled Tasks | 定时任务 Owner: chowlee-cc Summary: Create and manage OpenClaw scheduled tasks (reminders, periodic notifications, automated workflows). 创建和管理 OpenClaw 定时任务(提醒、定时推送、自动化工作流)。 Supports OpenClaw C... Tags: latest:2.1.7 Version history: v2.1.7 | 2026-03-26T17:55:22.839Z | user - Removed 10 auxiliary documentation and template files, including CHANGELOG.md, FEEDBACK.md, and all test scripts. - Consoli

62
Rank
84
Safety
1.3k
Downloads

About

What it does, and when to use it.

Capability contract not published. No trust telemetry is available yet. 1.3K downloads reported by the source. Last updated 10/10/2026.

Avoid when

  • Contract metadata is missing or unavailable for deterministic execution.

Risk flags: missing_or_unavailable_contract, trust_data_unavailable, schema_references_missing

Install and run

Setup complexity: low.

clawhub skill install s170zwvrhfa2669s91yfmnmfs583mpgn:scheduled-tasks
  1. Setup complexity is classified as HIGH. You must provision dedicated cloud infrastructure or an isolated VM. Do not run this directly on your local workstation.
  2. Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data.

Contract: missing

curl -s "https://www.xpersona.co/api/v1/agents/clawhub-chowlee-cc-scheduled-tasks/snapshot"

Run-check

$0.02 USD

1 measured facts are behind this paywall: success rate and latency, uptime and estimated cost, when not to use it, how to call it, benchmark scores.

Agents pay $0.02 in USDC. A card payment is $0.50, the smallest a card allows.

Documentation

CLAWHUB

146,203 characters of source documentation, loaded on request.

Extracted files

5 files captured from the source.

SKILL.md

---
name: scheduled-tasks
version: 2.1.7
description: >
  Create and manage OpenClaw scheduled tasks (reminders, periodic notifications, automated workflows).
  创建和管理 OpenClaw 定时任务(提醒、定时推送、自动化工作流)。
  Supports OpenClaw Cron API and system crontab with best practices and pitfall avoidance.
  支持 OpenClaw Cron API 和系统 crontab,包含最佳实践和避坑指南。
---

# Scheduled Tasks Skill | 定时任务技能

> **OpenClaw + 飞书定时任务解决方案**  
> **Version | 版本**: 2.1.7  
> **Author | 作者**: 9527  
> **License | 许可证**: MIT  

---

## Overview | 概述

This skill helps you create, manage, and troubleshoot scheduled tasks in OpenClaw. It supports two approaches: **OpenClaw Cron API** (recommended for Agent tasks) and **System Crontab** (for shell scripts).

本技能帮助您创建、管理和调试 OpenClaw 定时任务。支持两种方式:**OpenClaw Cron API**(推荐用于 Agent 任务)和**系统 Crontab**(适用于 Shell 脚本)。

### When to Use | 使用场景

| Scenario | Use OpenClaw Cron | Use System Crontab |
|----------|------------------|-------------------|
| One-time reminder (X minutes later) | ✅ `--at` | ❌ |
| Scheduled Agent task with reply | ✅ `--announce` | ⚠️ Complex |
| Scheduled shell script execution | ⚠️ Possible | ✅ Direct |
| Requires Agent thinking/tools | ✅ | ✅ via `openclaw agent` |
| Multiple Agents | ✅ `--agent` | ✅ `--agent` |
| Model/thinking override | ✅ `--model --thinking` | ❌ |
| Auto-retry on failure | ✅ Built-in | ❌ Manual |

| 场景 | 用 OpenClaw Cron | 用系统 Crontab |
|------|-----------------|---------------|
| 一次性提醒(X 分钟后) | ✅ `--at` | ❌ |
| 定时让 Agent 执行任务并回复 | ✅ `--announce` | ⚠️ 复杂 |
| 定时执行 Shell 脚本 | ⚠️ 可以 | ✅ 更直接 |
| 需要 Agent 思考和工具调用 | ✅ | ✅ 通过 `openclaw agent` |
| 需要指定不同 Agent | ✅ `--agent` | ✅ `--agent` |
| 需要模型/思考级别覆盖 | ✅ `--model --thinking` | ❌ |
| 任务失败自动重试 | ✅ 内置 | ❌ 需自行处理 |

**Principle | 原则**: Prefer OpenClaw Cron unless the task is essentially running a script without Agent involvement.  
**优先使用 OpenClaw Cron**,除非任务本质是运行脚本且不需要 Agent 参与。

---

## Quick Start | 快速开始

### One-Time Reminder | 一次性提醒

```bash
# Remind in 20 minutes | 20 分钟后提醒
openclaw cron add \
  --name "Water Reminder | 喝水提醒" \
  --at "20m" \
  --session main \
  --system-event "Time to drink water! 💧 | 主人,该喝水了 💧" \
  --wake now \
  --delete-after-run
```

### Daily Scheduled Task | 每日定时任务

```bash
# Daily news briefing at 08:00 | 每天 08:00 新闻播报
openclaw cron add \
  --name "Daily News | 每日新闻" \
  --cron "0 8 * * *" \
  --tz "Asia/Shanghai" \
  --session isolated \
  --agent <agent-id> \
  --message "Search today's news and send to user | 搜索今日新闻并推送" \
  --announce \
  --channel feishu \
  --to "user:<user_open_id>"
```

---

## Method 1: OpenClaw Cron API (Recommended) | 方式一:OpenClaw Cron API(推荐)

### Basic Commands | 基础命令

```bash
# List all tasks | 查看所有任务
openclaw cron list

# Run task manually | 手动触发任务
openclaw cron run <jobId>

# View run history | 查看运行历史
openclaw cron runs --id <jobId>

# Edit task | 编辑任务
openclaw cron edit <jobId> --message "New message | 新消息"

# Disable task | 禁用任务
openclaw cron edit <jobId> --enabled false

# Remove task | 删除任务
openclaw cro

README.md

# Scheduled Tasks Skill | 定时任务技能

> **OpenClaw + 飞书定时任务解决方案**  
> **Version | 版本**: 2.1.7  
> **Author | 作者**: 9527  
> **License | 许可证**: MIT  

---

## 🎯 功能特性

- ✅ 两种定时方式(OpenClaw Cron + 系统 Crontab)
- ✅ 一次性提醒和周期性任务
- ✅ 详细的故障排查指南
- ✅ 安全审查通过(无敏感信息)

---

## 📦 安装

```bash
clawhub install scheduled-tasks
```

---

## 🚀 快速开始

### 创建一次性提醒

```bash
openclaw cron add \
  --name "喝水提醒" \
  --at "20m" \
  --session main \
  --system-event "主人,该喝水了 💧" \
  --wake now \
  --delete-after-run
```

### 创建每日定时任务

```bash
openclaw cron add \
  --name "每日新闻" \
  --cron "0 8 * * *" \
  --tz "Asia/Shanghai" \
  --session isolated \
  --agent <agent-id> \
  --message "搜索今日新闻并推送" \
  --announce \
  --channel feishu \
  --to "user:<user_open_id>"
```

---

## 📁 目录结构

```
scheduled-tasks/
├── SKILL.md                          # 技能文档
├── README.md                         # 使用说明
├── LICENSE.md                        # MIT 许可证
├── scripts/
│   ├── task-manager.sh               # 任务管理工具
│   └── maintenance-reminder.sh       # 维护提醒脚本
└── references/
    └── troubleshooting.md            # 故障排查指南
```

**文件总数**: 6 个核心文件

---

## 📚 文档说明

| 文件 | 说明 |
|------|------|
| **SKILL.md** | 完整技能文档(双语) |
| **README.md** | 快速开始指南 |
| **scripts/** | 脚本工具 |
| **references/** | 故障排查指南 |

---

## 🛠️ 故障排查

遇到问题?查看 [references/troubleshooting.md](references/troubleshooting.md)

---

## 📋 更新日志

### Version 2.1.7 (2026-03-27)

**精简优化**:
- 🎯 只包含 6 个核心文件
- 🗑️ 移除 tests 目录(开发测试用)
- 🗑️ 移除模板文件(参考用)
- 🗑️ 移除所有内部文档
- ✅ 修复 Security Scan 问题
- ✅ 修复 frontmatter 格式
- ✅ 修复路径引用问题

**文件**:
- SKILL.md - 技能文档
- README.md - 使用说明
- LICENSE.md - MIT 许可证
- scripts/task-manager.sh - 任务管理
- scripts/maintenance-reminder.sh - 维护提醒
- references/troubleshooting.md - 故障排查

---

### Version 2.1.6 (2026-03-26)

**安全修复**:
- 🔒 移除敏感路径引用
- 🔒 添加安全声明
- 🔒 改进示例代码

---

### Version 2.1.0 (2026-03-26)

**初始合并版本**:
- 🎉 合并 scheduled-tasks 和 openclaw-scheduler
- 📚 完整双语文档
- 🧪 完整测试套件
- 🔒 安全审查通过

---

## 🙏 致谢

感谢所有贡献者!

---

## 📧 支持

- **文档**: https://docs.openclaw.ai
- **社区**: https://discord.com/invite/clawd
- **技能市场**: https://clawhub.com

---

*Made with 💙 by 9527*

_meta.json

{
  "ownerId": "kn78eqkr6mprhxqveh52w14krn83nx8h",
  "slug": "scheduled-tasks",
  "version": "2.1.7",
  "publishedAt": 1774547722839
}

references/troubleshooting.md

# 定时任务排查指南

## 常见问题及解决方案

### 1. OpenClaw Cron 任务没有执行

**排查步骤**:

```bash
# 1. 检查任务是否存在
openclaw cron list

# 2. 检查 Gateway 是否运行
openclaw gateway status

# 3. 检查任务是否 enabled
openclaw cron list | grep <任务名>

# 4. 手动触发测试
openclaw cron run <jobId>

# 5. 查看运行历史
openclaw cron runs --id <jobId> --limit 10
```

**常见原因**:
- Gateway 未运行(cron 依赖 Gateway 进程)
- 任务被禁用(`enabled: false`)
- 时区错误(默认 UTC,中国需要 `Asia/Shanghai`)
- cron 表达式写错

---

### 2. 系统 Crontab 任务没有执行

**排查步骤**:

```bash
# 1. 确认 crontab 已添加
crontab -l

# 2. 检查日志
tail -50 /tmp/<task-name>.log

# 3. 检查脚本权限
ls -la /path/to/script.sh
# 需要有执行权限 (chmod +x)

# 4. 手动执行脚本
bash /path/to/script.sh

# 5. 检查 cron 服务
systemctl status cron
```

**常见原因**:
- 脚本没有执行权限(`chmod +x`)
- PATH 环境变量不完整(cron 环境很干净)
- 脚本路径错误
- cron 服务未运行
- 日志目录不存在

---

### 3. 飞书消息没有送达

**排查步骤**:

```bash
# 1. 检查 Agent 飞书账号配置
# 方法 A: 使用环境变量(推荐)
echo $OPENCLAW_AGENT_ID

# 方法 B: 查看您的配置文件(请谨慎操作)
# 注意:此命令仅用于查找您自己的配置,技能本身不访问这些文件
# grep -A 10 "agent-id" /path/to/your/openclaw.json

# 2. 检查 open_id 是否正确
# open_id 格式:ou_xxxxxxxxxxxx(完整 32+ 位)

# 3. 检查飞书应用权限
# 需要"以应用身份发消息"权限

# 4. 手动测试发送
openclaw agent --agent <id> --deliver \
  --reply-account <account> \
  --reply-to "user:<open_id>" \
  -m "测试消息"
```

**常见原因**:
- `--reply-to` 格式错误(必须是 `user:ou_xxx`)
- `--reply-account` 与 Agent 飞书账号不匹配
- 飞书应用缺少发消息权限
- open_id 不完整或错误
- 未使用 `--deliver` 参数

---

### 4. `openclaw agent` 命令报错

**常见错误**:

| 错误信息 | 原因 | 解决方案 |
|---------|------|---------|
| `too many arguments for 'agent'` | 消息内容被当作位置参数 | 用 `-m "消息"` 明确指定 |
| `Delivering to Feishu requires target` | 缺少投递目标 | 添加 `--reply-account` 和 `--reply-to` |
| `gateway closed` | Gateway 未运行或连接断开 | `openclaw gateway restart` |
| `Session send visibility is restricted` | 跨 Agent 通信受限 | 用 `openclaw agent` 命令替代 |

---

### 5. 时间不对

**排查**:

```bash
# 检查系统时区
timedatectl

# 检查 OpenClaw 使用的时区
# cron 表达式默认用主机时区
# --at 时间不带时区默认 UTC

# 中国用户必须指定时区
--tz "Asia/Shanghai"           # cron 表达式
--at "2026-03-19T09:00:00+08:00"  # 一次性(带 +08:00)
```

**时区对照**:

| 写法 | 实际执行时间(北京) |
|------|-------------------|
| `--at "2026-03-19T09:00:00"` | 17:00(UTC 被当作北京时间差 8 小时) |
| `--at "2026-03-19T09:00:00Z"` | 17:00(UTC 明确标注) |
| `--at "2026-03-19T09:00:00+08:00"` | 09:00 ✅ |
| `--cron "0 9 * * *"` 无 --tz | 取决于主机时区 |
| `--cron "0 9 * * *" --tz "Asia/Shanghai"` | 09:00 ✅ |

---

### 6. 定时任务重试和失败

**OpenClaw Cron 重试机制**:

一次性任务(`--at`):
- 临时错误(限流、网络):最多重试 3 次(30s → 1m → 5m)
- 永久错误(认证、配置):���即禁用

定期任务(`--cron`):
- 任何错误:指数退避(30s → 1m → 5m → 15m → 60m)
- 成功后退避重置

**查看失败详情**:

```bash
openclaw cron runs --id <jobId> --limit 10
```

---

## 调试清单

创建定时任务后,按此清单验证:

- [ ] `openclaw cron list` 确认任务已创建
- [ ] 时区正确(`Asia/Shanghai`)
- [ ] `openclaw cron run <jobId>` 手动触发成功
- [ ] `openclaw cron runs --id <jobId>` 查看运行结果
- [ ] 飞书/目标渠道收到消息
- [ ] 日志无报错

LICENSE.md

MIT License

Copyright (c) 2026 OpenClaw Community

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Sponsored

Ads related to Scheduled Tasks | 定时任务 and adjacent AI workflows.