360 Secure SkillHub
360 安全技能中心

Crontab Validator

核心功能包括验证Cron表达式语法正确性、生成人类可读的详细解释、计算指定时间点后的下次运行时间、检查常见配置错误(如无效日期、高频调度等)。典型场景:确认Cron表达式是否合法、理解复杂表达式含义、查看任务调度时间、排查调度配置问题。支持多种Cron语法及快捷方式,输入为Cron表达式,输出支持JSON、Markdown等格式,通过命令行调用。

charlie-morrison
charlie-morrison
热度 53.17
最近更新 2026-05-11 17:42:36
分类:开发依赖:代码执行应用场景:DevOps / 自动化脚本 / 调试排错 / 代码审查

安装技能

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

执行命令安装此 skill: npx secure-skills-cli add crontab-validator
Metadata
name
crontab-validator
description
Validate, explain, lint, and calculate next run times for cron expressions. Use when asked to check cron syntax, explain a crontab entry, find next scheduled runs, or lint cron expressions for common mistakes. Triggers on "crontab", "cron expression", "cron schedule", "cron syntax", "cron explain", "cron next run", "*/5 * * * *".

Crontab Validator & Explainer

Validate cron syntax, get human-readable explanations, calculate next run times, and lint for common mistakes.

Validate

# Single expression
python3 scripts/cron_check.py validate "*/15 * * * *"

# Multiple expressions with lint
python3 scripts/cron_check.py validate --lint "0 2 * * *" "* * * * *" "0 0 31 2 *"

Explain in Detail

python3 scripts/cron_check.py explain "30 4 1,15 * 1-5"

Next Run Times

# Next 5 runs (default)
python3 scripts/cron_check.py next "0 9 * * 1-5"

# Next 10 runs
python3 scripts/cron_check.py next "0 */6 * * *" --count 10

# From specific time
python3 scripts/cron_check.py next "0 9 * * *" --from-time 2026-01-01T00:00:00

Lint

# Check for common mistakes
python3 scripts/cron_check.py lint "* * * * *" "0 0 31 2 *" "0 0 29 2 *"

# Strict mode (exit 1 on warnings)
python3 scripts/cron_check.py lint --strict "0 0 31 4 *"

Output Formats

python3 scripts/cron_check.py -f json explain "0 9 * * 1-5"
python3 scripts/cron_check.py -f markdown validate --lint "*/5 * * * *"

Supported Syntax

Feature Example Description
Wildcard * Every value
Specific 5 Exact value
Range 1-5 Values 1 through 5
List 1,3,5 Values 1, 3, and 5
Step */15 Every 15th value
Range+Step 1-30/2 Odd values 1-30
Names mon-fri Day/month names
Shortcuts @daily Predefined schedules

Shortcuts

Shortcut Equivalent Meaning
@yearly 0 0 1 1 * Once a year
@monthly 0 0 1 * * First of month
@weekly 0 0 * * 0 Every Sunday
@daily 0 0 * * * Every midnight
@hourly 0 * * * * Every hour

Lint Checks

Check Level Description
Every-minute Warning * * * * * runs 1440 times/day
Day 31 in short months Warning Apr, Jun, Sep, Nov have 30 days
Feb 29-31 Warning Only runs in leap years (29) or never
DOM + DOW conflict Info Both specified = OR logic
High frequency Info More than 288 runs/day