← 返回 Skills 市场
114
总下载
1
收藏
0
当前安装
8
版本数
在 OpenClaw 中安装
/install linux-cron-panel
功能描述
Linux 定时任务 Web 管理面板 - 通过 API 管理 Linux crontab,支持自动安装、任务创建、编辑、删除、立即执行和日志查看。当用户需要管理 Linux 定时任务、crontab、计划任务时使用本 skill。
使用说明 (SKILL.md)
SKILL.md - Linux Cron Panel
配合 Linux Cron Panel 项目使用,通过 API 管理 Linux crontab,后端自动处理回调上报。
前置检查与自动安装
使用本 skill 前,必须先确保 Linux Cron Panel 服务可用。
检查与启动流程
步骤 1:检查服务是否运行
curl -sS http://127.0.0.1:5002/api/version
如果返回 JSON 版本信息,说明服务正常,直接使用。如果连接失败,继续下一步。
步骤 2:检查并安装
if [ -d "$HOME/.openclaw/linux-cron-panel" ]; then
# 已安装,启动服务
cd "$HOME/.openclaw/linux-cron-panel"
bash start.sh
else
# 未安装,执行安装
git clone https://github.com/wdmywm3/linux-cron-panel.git "$HOME/.openclaw/linux-cron-panel"
# 配置 systemd 服务
mkdir -p "$HOME/.config/systemd/user"
cat > "$HOME/.config/systemd/user/linux-cron-panel.service" \x3C\x3C 'SERVICE_EOF'
[Unit]
Description=Linux Cron Panel API Service
After=network.target
[Service]
Type=forking
WorkingDirectory=%h/.openclaw/linux-cron-panel
ExecStart=bash start.sh
Restart=always
RestartSec=10
TimeoutStopSec=30
[Install]
WantedBy=default.target
SERVICE_EOF
# 启动服务
systemctl --user daemon-reload
systemctl --user enable --now linux-cron-panel
fi
步骤 3:验证
curl -sS http://127.0.0.1:5002/api/version
服务信息
- Base URL: http://127.0.0.1:5002
- 数据格式: JSON
- 任务主键: id (格式: task_xxxxxxxx)
脚本管理
创建任务需要执行脚本时,优先使用 ~/.openclaw/scripts/ 作为脚本存储路径。
创建脚本目录
mkdir -p "$HOME/.openclaw/scripts"
创建并写入脚本示例
SCRIPT_DIR="$HOME/.openclaw/scripts"
mkdir -p "$SCRIPT_DIR"
# 创建脚本
cat > "$SCRIPT_DIR/my-task.sh" \x3C\x3C 'EOF'
#!/bin/bash
echo "Task started at $(date)"
# 你的任务逻辑
echo "Task finished"
EOF
# 添加执行权限
chmod +x "$SCRIPT_DIR/my-task.sh"
创建任务时使用脚本路径
curl -sS -X POST http://127.0.0.1:5002/api/tasks \
-H 'Content-Type: application/json' \
-d '{
"name": "我的定时任务",
"cron_expr": "*/10 * * * *",
"command": "'"$SCRIPT_DIR"'/my-task.sh",
"enabled": true
}' | jq
日志输出规范
脚本如需自行写入日志文件,建议遵循以下格式以便后续查看和维护。
推荐格式
[YYYY-MM-DD HH:MM:SS] [LEVEL] 消息内容
| 字段 | 说明 | 示例 |
|---|---|---|
| 时间戳 | 日期时间 | [2026-04-03 21:30:00] |
| 级别 | INFO/WARN/ERROR | [INFO] |
| 消息 | 具体内容 | 备份完成,共 15MB |
脚本示例
#!/bin/bash
LOG_FILE="$HOME/.openclaw/linux-cron-panel/logs/my-task.log"
# 日志函数
log() {
echo "[$(date '+%Y-%m-%d %H:%M:%S')] [$1] $2" >> "$LOG_FILE"
}
log "INFO" "任务开始"
# ... 任务逻辑 ...
log "INFO" "任务完成"
查看日志
# panel 任务执行日志(stdout/stderr)
curl -sS http://127.0.0.1:5002/api/tasks/{id}/log
# 脚本自行写入的日志
tail -f ~/.openclaw/linux-cron-panel/logs/my-task.log
核心 API
1. 查询版本号
curl -sS http://127.0.0.1:5002/api/version
2. 查询任务列表
curl -sS http://127.0.0.1:5002/api/tasks | jq
3. 查询任务详情
curl -sS http://127.0.0.1:5002/api/tasks/{id} | jq
4. 创建任务
curl -sS -X POST http://127.0.0.1:5002/api/tasks \
-H 'Content-Type: application/json' \
-d '{
"name": "任务名称",
"cron_expr": "*/10 * * * *",
"command": "/path/to/script.sh",
"log_file": "/tmp/task.log",
"enabled": true
}' | jq
说明:后端会自动包装 command,添加回调上报逻辑,无需手动处理。
5. 编辑任务
curl -sS -X PUT http://127.0.0.1:5002/api/tasks/{id} \
-H 'Content-Type: application/json' \
-d '{
"name": "新名称",
"cron_expr": "0 */6 * * *",
"command": "新命令",
"enabled": true
}' | jq
6. 删除任务
curl -sS -X DELETE http://127.0.0.1:5002/api/tasks/{id} | jq
7. 立即运行任务
curl -sS -X POST http://127.0.0.1:5002/api/tasks/{id}/run | jq
8. 启用/禁用切换
curl -sS -X POST http://127.0.0.1:5002/api/tasks/{id}/toggle | jq
9. 读取任务日志
curl -sS http://127.0.0.1:5002/api/tasks/{id}/log
10. 状态汇总
curl -sS http://127.0.0.1:5002/api/status | jq
任务对象结构
{
"id": "task_d9ea3ed9ef4443c3",
"name": "任务名称",
"cron_expr": "*/10 * * * *",
"command": "/path/to/script.sh",
"log_file": "/tmp/task.log",
"enabled": true,
"last_run": "2026-04-03 13:00:00",
"last_status": "success",
"last_exit_code": 0,
"history": [...]
}
Cron 表达式格式
标准 Linux crontab 格式:
* * * * * command
│ │ │ │ │
│ │ │ │ └─── 星期 (0-7, 0和7都是周日)
│ │ │ └───── 月份 (1-12)
│ │ └─────── 日期 (1-31)
│ └───────── 小时 (0-23)
└─────────── 分钟 (0-59)
常用示例:
*/5 * * * *- 每5分钟0 * * * *- 每小时0 0 * * *- 每天零点0 9 * * 1-5- 工作日9点
调用流程
- 前置检查: GET /api/version 验证服务运行
- 创建脚本目录:
mkdir -p ~/.openclaw/scripts - 创建脚本: 写入脚本并添加执行权限
- 创建任务: POST /api/tasks → 使用脚本路径作为 command
- 验证: GET /api/tasks/{id} 确认任务状态
- 编辑/删除: 使用对应 API 操作
项目地址
- Repository: https://github.com/wdmywm3/linux-cron-panel
安全使用建议
This skill will clone and run code from https://github.com/wdmywm3/linux-cron-panel and create a persistent systemd --user service under your account. Before installing: (1) review the repository content (especially start.sh and any network/callback code) and consider pinning a specific commit or checksum; (2) run the software in a disposable VM or container if possible; (3) confirm where the 'callback/reporting' sends data and what it includes (logs, stdout, environment); (4) avoid running it as root and inspect the systemd unit it writes; (5) if you don't want persistent background services, do not enable the systemd step and instead run the service manually for testing. If you proceed, keep a way to remove the service and delete ~/.openclaw and the systemd unit to fully revoke persistence.
功能分析
Type: OpenClaw Skill
Name: linux-cron-panel
Version: 1.2.0
The skill automates the installation of a third-party tool by cloning a remote repository (github.com/wdmywm3/linux-cron-panel.git) and executing a startup script (start.sh). It also establishes persistence on the host system by creating and enabling a systemd user service (linux-cron-panel.service). While these actions are aligned with the stated purpose of providing a cron management panel, the automated downloading and execution of remote code combined with background persistence mechanisms represent high-risk behaviors.
能力评估
Purpose & Capability
The name/description (a web panel to manage crontab via API) aligns with the runtime instructions: installing the linux-cron-panel repo, starting it, and calling its local API to manage tasks. There are no requested environment variables or unrelated binaries that would be unexpected for this purpose.
Instruction Scope
The SKILL.md instructs the agent to git clone a public repo into ~/.openclaw, run the repository's start.sh, and enable a persistent systemd --user service. It also states the backend '自动包装 command,添加回调上报逻辑' (automatically wraps commands and adds callback/reporting logic) without specifying where callbacks go or what data is reported. Those instructions go beyond simple API usage and include executing arbitrary code and creating persistent services under the user's account.
Install Mechanism
There is no formal install spec, but the instructions explicitly run git clone from a GitHub repository and then execute start.sh from that clone. Cloning and executing unverified code from a repo (no pinned commit or checksum) is a supply-chain risk: the repo's contents could change or contain unexpected behavior. This is a moderate-to-high install risk for an instruction-only skill.
Credentials
The skill does not request any environment variables or external credentials (which is appropriate). However it does require writing files in the user's home (~/.openclaw, ~/.config/systemd/user) and creating scripts under ~/.openclaw/scripts — reasonable for the tool but still grants persistent filesystem access in the user account.
Persistence & Privilege
The instructions create and enable a user-level systemd service that will auto-restart and run start.sh from the cloned repo, giving the skill persistent execution under the user's account. Combined with the unverified code execution and the unspecified callback/reporting behavior, this persistence increases risk (service will run repeatedly and could exfiltrate data or execute new code if the repo changes).
如何使用
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install linux-cron-panel - 安装完成后,直接呼叫该 Skill 的名称或使用
/linux-cron-panel触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.2.0
新增日志输出规范章节
v1.1.5
Remove _meta.json, only skill files
v1.1.4
Clean up: remove project files, keep only skill files
v1.1.3
Fix: Add YAML frontmatter to SKILL.md for proper skill discovery
v1.1.2
- Internal implementation removed: 12 files deleted, including backend, frontend, and utility scripts.
- Skill documentation (SKILL.md) remains as reference for using Linux Cron Panel via API.
- This version removes all bundled server/frontend code and supporting files, leaving only documentation.
v1.1.1
- Improved clarity and formatting in installation and service setup instructions in SKILL.md.
- Replaced heredoc marker from EOF to SERVICE_EOF for systemd service block.
- Enhanced step labels and separation for pre-check, installation, and verification.
- No changes to core functionality or APIs; documentation update only.
v1.1.0
linux-cron-panel 1.1.0 introduces a major update with a frontend, code reorganization, and enhanced script management:
- Added 12 new files, including a React frontend (frontend/src), backend/server.py, cron-wrappers/wrapper.sh, and startup scripts.
- Updated documentation with recommended script storage directory (`~/.openclaw/scripts`) and usage examples.
- Enhanced installation, startup, and systemd service instructions.
- Updated SKILL.md with expanded guidance on script directory setup.
- Core API and payload structure remain unchanged.
v1.0.0
Initial release: manage Linux crontab via API with auto callback
元数据
常见问题
Linux Cron Panel 是什么?
Linux 定时任务 Web 管理面板 - 通过 API 管理 Linux crontab,支持自动安装、任务创建、编辑、删除、立即执行和日志查看。当用户需要管理 Linux 定时任务、crontab、计划任务时使用本 skill。 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 114 次。
如何安装 Linux Cron Panel?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install linux-cron-panel」即可一键安装,无需额外配置。
Linux Cron Panel 是免费的吗?
是的,Linux Cron Panel 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
Linux Cron Panel 支持哪些平台?
Linux Cron Panel 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 Linux Cron Panel?
由 wdmywm3(@wdmywm3)开发并维护,当前版本 v1.2.0。
推荐 Skills