首页 全栈极客与开发辅助内容详情

Cron Translator: Read 0 9 * * 1-5 Without Guessing - Paste a line, see the next five runs

2026-10-29 20
Cron Translator: Read 0 9 * * 1-5 Without Guessing

站点名称:Cron Translator: Read 0 9 * * 1-5 Without Guessing

所属分类:全栈极客与开发辅助

相关标签: # cron # crontab # scheduler # devtools

官方网址:https://www.9314.cn/tools/cron-translator/en/

SEO查询: 爱站网 站长工具

进入网站

站点介绍

Cron Translator: Read 0 9 * * 1-5 Without Guessing

TL;DR

  • Most broken cron jobs fail on two defaults, not on syntax: five fields and six fields are different languages, and day-of-month plus day-of-week means OR.
  • 0 0 1 * 1 is not "the 1st if it is a Monday". It is "the 1st, or any Monday".
  • You do not learn cron by memorising fields. You learn it by reading the next five run times.
  • Built a page for it: paste, translate, field by field, your timezone, and the reverse direction too. Open the translator.

1. The outage was one missing asterisk

2 AM, the report never ran. The log was empty, not even an error, which means the job never started.

One asterisk was missing. Four fields instead of five. Linux said nothing, the job did nothing, and it sat there quietly for three days.

That is cron's temperament: it does not complain, it just does not run.

2. Five fields and six fields are different species

Standard crontab takes five fields: minute, hour, day of month, month, day of week. Linux, macOS and most cloud schedulers follow it.

Quartz and Spring take six, with a seconds field in front. Paste six into a Linux crontab and it is a syntax error. Paste five into Spring and it reads the first value as seconds, shifting everything one column.

Copy from where it runs. That sentence saves half your debugging time.

3. Day-of-month plus day-of-week is OR

This is the one that bites. People read 0 0 1 * 1 as "the 1st, and only when it falls on a Monday", meaning the first Monday of the month.

It actually means "the 1st, or any Monday". That fires four or five times a month. You think you are hunting a bug; you are reading the spec backwards.

Standard cron cannot express "first Monday of the month". Check the date inside the script, or move to Quartz # syntax. Do not improvise a range, it only gets wider.

4. Read the next five runs instead of the manual

A syntax table never sticks. "The next five runs are these five timestamps" sticks immediately.

The page does three things: translates on paste, explains what every field controls, and lists the next five runs in your device timezone. Each row also shows the UTC time, so when your server logs in UTC you compare directly instead of doing eight-hour arithmetic in your head.

When a schedule can never fire, February 30th for instance, it says so instead of pretending.

5. It also works backwards

Describe the schedule in plain English: every weekday at 8:30 am becomes 30 8 * * 1-5. Chinese works too.

Then the same page explains what you just generated, so you can confirm it before it reaches the crontab.

FAQ

My expression has 6 fields with seconds. Can I paste it? Yes. Quartz and Spring prepend a seconds field, so the page drops it and evaluates the remaining five, with a note to confirm which platform you target. Going the other way, pasting six fields into a Linux crontab is a syntax error.

The times here are 8 hours off from my server logs. This page uses your device timezone, and most servers run UTC. Every run row shows the UTC time too, so compare that against the log. An eight-hour gap is timezone, not a broken expression.

How do I schedule the first Monday of the month? Standard cron cannot express it. 0 9 1-7 * 1 reads as the 1st through the 7th, or any Monday, which is wider than you want. Check the date inside the script, or switch to Quartz # syntax.

Does this page keep my expression? No. Everything runs in your browser, no request is sent, nothing is logged, and a refresh clears it. Cron lines often carry paths and account names, so nothing leaves the tab.

中文版:https://www.9314.cn/tools/cron-translator/

浏览统计(最近30天)

 暂无评论,快来抢沙发吧~

发布评论