← 返回 Skills 市场
gdxbsv

Script Cron Jobs (no LLM)

作者 Sergei Baikin · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ⚠ suspicious
29
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install cron-scripts
功能描述
Run bash scripts on a schedule without LLM involvement. Zero model cost, hot-reload, pure shell. A workaround until openclaw/openclaw#80793 lands.
使用说明 (SKILL.md)

cron-scripts 🕐

Run bash scripts on a schedule — no LLM, no agent turns, zero model cost.

This is a practical workaround for the missing payload.kind: "script" in OpenClaw cron (issue #80793, issue #18160). It uses a gateway startup hook to load a directory of shell scripts and schedule them with the same croner library OpenClaw already bundles — no extra dependencies.

When to use this (not LLM crons)

Use script cron Use LLM cron
Health checks, HTTP pings Summarising logs
File/lock cleanup Deciding what to report
Fixed Telegram/webhook notifications Writing weekly digests
Git pulls, backups Any task needing reasoning
Watching directories for changes Classifying content

If a task doesn't need a brain, it shouldn't spin up one.

Installation

1. Install the gateway hook

Copy hooks/cron-scripts-loader/handler.ts from this skill into your OpenClaw hooks directory:

mkdir -p ~/.openclaw/hooks/cron-scripts-loader
cp \x3Cskill-dir>/hooks/cron-scripts-loader/handler.ts \
   ~/.openclaw/hooks/cron-scripts-loader/handler.ts

Then restart the gateway:

openclaw gateway restart

The hook registers itself on gateway.startup and begins watching ~/.openclaw/cron-scripts/ immediately. No further config needed.

2. Create your scripts directory

mkdir -p ~/.openclaw/cron-scripts

The hook creates this automatically on first startup, but creating it now lets you add scripts before restarting.

Writing scripts

Every script needs a short frontmatter block in the first 20 lines:

#!/usr/bin/env bash
# name: my-job          # required — shown in gateway logs
# schedule: 0 8 * * *  # required — standard 5-field cron expression
# tz: Europe/Berlin     # optional — IANA timezone (default: UTC)
# timeout: 120          # optional — seconds before SIGTERM (default: 120)

# ... your script here

The cron expression is written in wall-clock time of the given tz — do not convert to UTC yourself.

Then drop it in ~/.openclaw/cron-scripts/ and make it executable:

chmod +x ~/.openclaw/cron-scripts/my-job.sh

No restart needed. The hook watches the directory with fs.watch and hot-reloads within ~300ms of any file change.

Sending notifications from scripts

Scripts can post to any OpenClaw channel via the local announce API:

# Post to a Telegram user
curl -sf -X POST http://localhost:3000/api/announce \
  -H "Content-Type: application/json" \
  -d "{\"text\": \"Hello from script cron\", \"channel\": \"telegram\", \"to\": \"\x3CYOUR_CHAT_ID>\"}"

Or call external services directly (Telegram Bot API, Slack webhooks, etc.).

Disabling / deleting a job

  • Disable: rename to my-job.sh.disabled — the watcher ignores non-.sh files
  • Delete: remove the file — job stops within 300ms, no restart needed

Logs

All script output is captured and forwarded to the gateway log under [cron-scripts-loader][\x3Cname>]:

[cron-scripts-loader][my-job] Starting run
[cron-scripts-loader][my-job] some stdout line
[cron-scripts-loader][my-job] Finished ok (exit 0)

Non-zero exit codes are logged as errors but never crash other jobs.

Example script

See examples/health-check.sh for a minimal HTTP health check that posts failures to Telegram.

Constraints

  • Scripts run as the same user as the gateway process
  • Pure bash — no access to the OpenClaw tool system
  • If a previous run is still active when the next tick fires, the new run is skipped (croner protect: true) to prevent pile-ups
  • Relies on croner from OpenClaw's own node_modules — tested against OpenClaw 2026.x; if croner moves, update the require path in the hook

Context

This skill was built as a workaround for:

If those issues are resolved natively, this skill becomes unnecessary. Until then, it's the cleanest way to keep your cron inventory unified in one place without burning model tokens on tasks that are pure bash.

安全使用建议
Install only if you intentionally want OpenClaw to run local bash scripts automatically. Treat ~/.openclaw/cron-scripts as a trusted-code directory, lock down its permissions, review every script before adding it, and prefer a low-privilege gateway account because scripts can access that user's files, network, and environment variables.
能力评估
Purpose & Capability
The stated purpose matches the artifact: it loads .sh files from ~/.openclaw/cron-scripts and schedules them through an OpenClaw gateway startup hook.
Instruction Scope
The README discloses shell scheduling, hot reload, startup hook use, and same-user execution, but the security warning is not prominent and it does not clearly explain that scripts inherit the gateway process environment.
Install Mechanism
Installation copies a TypeScript handler into ~/.openclaw/hooks/cron-scripts-loader and restarts the gateway, creating a durable startup execution path rather than a one-time skill instruction.
Credentials
The handler runs bash scripts with env: { ...process.env }, so any scheduled script can access gateway environment variables and any files or network resources available to that user.
Persistence & Privilege
On each gateway startup the hook creates or watches ~/.openclaw/cron-scripts, auto-loads every .sh file there, and hot-reloads changed scripts; there is no explicit uninstall or isolation guidance.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install cron-scripts
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /cron-scripts 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release — gateway hook + frontmatter-driven bash scheduler. Zero model cost workaround for openclaw/openclaw#80793 and #18160.
元数据
Slug cron-scripts
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

Script Cron Jobs (no LLM) 是什么?

Run bash scripts on a schedule without LLM involvement. Zero model cost, hot-reload, pure shell. A workaround until openclaw/openclaw#80793 lands. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 29 次。

如何安装 Script Cron Jobs (no LLM)?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install cron-scripts」即可一键安装,无需额外配置。

Script Cron Jobs (no LLM) 是免费的吗?

是的,Script Cron Jobs (no LLM) 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Script Cron Jobs (no LLM) 支持哪些平台?

Script Cron Jobs (no LLM) 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Script Cron Jobs (no LLM)?

由 Sergei Baikin(@gdxbsv)开发并维护,当前版本 v1.0.0。

💬 留言讨论