Files
sproutclaw-cron/_template-javascript/README.md
shumengya c10cacd5c6 feat: 多语言任务、WebUI 增强与 Agent MCP 集成
重构 lib 为扁平模块并支持 Windows schtasks;新增 JS/Bash/PowerShell 模板、WebUI 调度编辑,以及 Cursor Skill 与 MCP 工具供 Agent 管理定时任务。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-24 21:45:25 +08:00

33 lines
773 B
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.
# JavaScript 定时任务模板
Node.js hello world 示例。调度仍由 `cronctl.py run` 统一管理disable / 锁 / 日志)。
## 依赖
- Python 3cronctl
- Node.js`node` 在 PATH 中)
## 新建任务
```bash
TASK_ID="smallmengya-my-js-task"
CRON_ROOT="/shumengya/project/agent/sproutclaw-cron"
cp -a "$CRON_ROOT/_template-javascript" "$CRON_ROOT/$TASK_ID"
sed -i "s/_template-javascript/$TASK_ID/g" "$CRON_ROOT/$TASK_ID/schedule.cron"
```
编辑 `run.js``schedule.cron` 后试跑:
```bash
python3 "$CRON_ROOT/cronctl.py" run "$TASK_ID"
```
## 其他语言模板
| 目录 | 语言 |
|---|---|
| `_template` | Python默认 |
| `_template-javascript` | JavaScript |
| `_template-bash` | Bash |
| `_template-powershell` | PowerShell |