cron 表达式解析
用通俗语言解释五段式 cron 表达式,并列出接下来会运行的时间。
完全在浏览器中运行 — 粘贴的内容不会被上传。
cron 语法速查表
快速参考- 分 0-59
- 第一个字段。*/5 表示每五分钟,0,30 表示整点和半点。
- 时 0-23
- 24 小时制的第二个字段,9 即 09:00,21 即晚上 9 点。
- 日 1-31
- 第三个字段。与星期字段同时受限时取“或”关系。
- 月 1-12 / JAN-DEC
- 第四个字段,可用数字或名称,不区分大小写。
- 星期 0-6 / SUN-SAT
- 第五个字段,0 和 7 都表示周日,常用 MON-FRI 表示工作日。
- 0 9 * * 1-5
- 工作日 09:00。其他常见:0 0 * * * 每天零点,*/15 * * * * 每 15 分钟,0 0 1 * * 每月 1 日。
Linux 相关语法指南
全部 Linux 指南systemd Timers vs Cron: Missing PATH, Overlapping Runs, Time Drift
Cron runs a bare shell with no profile and no locking, and systemd reads the system time zone. The environment, single-instance and schedule fixes for both.
LinuxBash Indexed Arrays, Associative Maps, and Parameter Expansion
Quoting decides whether an array stays a list, and the expansion operators replace most external text tools. Includes set -u, mapfile, namerefs, and the bash 3.2 differences that break scripts on macOS.
LinuxParsing JSON and YAML in Shell Pipelines with jq and yq
jq is a filter language, not a pretty-printer. The operators that do the work, --arg versus string interpolation, in-place YAML edits, and how to tell which yq is installed before writing a command.
LinuxLinux Memory, Swap, the OOM Killer, vmstat, and sysctl Tuning
MemAvailable versus used, the vmstat columns that prove thrashing, how the OOM killer picks its victim, and the sysctl keys that belong in /etc/sysctl.d instead of a one-off command.