360 Secure SkillHub
360 安全技能中心

Pilot Cron

该 Skill 提供基于 crontab、systemd timer 和 sleep 循环的周期性调度方式,并给出用 pilotctl 向 Pilot 网络代理提交任务的示例脚本;依赖 pilot-protocol skill、pilotctl 二进制、运行中的 daemon 与 jq。

teoslayer
teoslayer
热度 34.75
最近更新 2026-05-11 17:41:28
分类:自动化依赖:代码执行 / 读写文件 / 第三方 API应用场景:日程安排 / 自动化脚本 / 工作流 / 任务管理

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add pilot-cron
Metadata
name
pilot-cron
description
Scheduled recurring task submission. Use this skill when: 1. You need periodic task execution on a fixed schedule 2. You want automated recurring tasks without manual intervention 3. You need time-based triggers for network operations Do NOT use this skill when: - Tasks should trigger on events, not time (use pilot-workflow) - You only need to run a task once - The schedule is irregular and can't be expressed as a cron pattern
tags
["pilot-protocol","task-workflow","scheduling","automation"]
license
AGPL-3.0
compatibility
Requires pilot-protocol skill and pilotctl binary on PATH. The daemon must be running (pilotctl daemon start).
metadata
{"author":"vulture-labs","version":"1.0","openclaw":{"requires":{"bins":["pilotctl"]},"homepage":"https://pilotprotocol.network"}}
allowed-tools
["Bash"]

pilot-cron

Scheduled recurring task submission using cron-style scheduling. Enables automated periodic task execution across the Pilot network.

Commands

Add cron job:

crontab -l | { cat; echo "0 * * * * /path/to/submit-task.sh"; } | crontab -  # Every hour
crontab -l | { cat; echo "0 2 * * * /path/to/daily-backup.sh"; } | crontab -  # Daily at 2 AM

Systemd timer (more reliable):

cat > ~/.config/systemd/user/pilot-task.timer <<EOF
[Timer]
OnCalendar=hourly
Persistent=true
EOF

systemctl --user enable pilot-task.timer
systemctl --user start pilot-task.timer

Simple sleep loop:

while true; do
  /path/to/submit-task.sh
  sleep 3600  # 1 hour
done

List scheduled tasks:

crontab -l
systemctl --user list-timers

Workflow Example

#!/bin/bash
# Create and install cron jobs

SCRIPT_DIR="$HOME/.pilot/cron-jobs"
mkdir -p "$SCRIPT_DIR"

# Health check script - every 5 minutes
cat > "$SCRIPT_DIR/health-check.sh" <<'EOF'
#!/bin/bash
AGENT=$(pilotctl --json peers --search "monitor" | jq -r '.[0].address')
pilotctl --json task submit "$AGENT" --task "Perform health check and report status"
EOF
chmod +x "$SCRIPT_DIR/health-check.sh"

# Install cron jobs
crontab -l 2>/dev/null | grep -v 'pilot-cron' > /tmp/crontab.tmp || true
cat >> /tmp/crontab.tmp <<EOF
# pilot-cron: Health check every 5 minutes
*/5 * * * * $SCRIPT_DIR/health-check.sh >> $HOME/.pilot/logs/health-check.log 2>&1
EOF
crontab /tmp/crontab.tmp
rm /tmp/crontab.tmp

echo "Cron jobs installed"

Common Cron Patterns

* * * * *       # Every minute
*/5 * * * *     # Every 5 minutes
0 * * * *       # Every hour
0 2 * * *       # Daily at 2 AM
0 9 * * 1       # Monday at 9 AM
0 0 1 * *       # First day of month

Dependencies

Requires pilot-protocol skill, pilotctl binary, running daemon, jq, and cron or systemd timer support.