Ir para o conteúdo
DevTools / Analisador de expressões cron

Analisador de expressões cron

A cron expression is five or six fields of terse punctuation that determine when a job runs, and getting one wrong usually means discovering the mistake when a job either never fires or fires far more often than intended. This parser explains each field in words, renders the next several run times as actual dates in the timezone you select, warns about the daylight-saving transitions that silently skip or repeat a run, and documents the syntax extensions that differ between cron implementations.

Roda inteiramente no navegador — nada é enviado.

Plain-language meaning

at minute */15 of hour 9-17, on 1 through 5.

FieldExpressionRangeKindMeaning
Minute*/150–59stepevery 15 minutes
Hour9-170–23range9 through 17
Day of month*1–31wildcardevery value
Month*1–12wildcardevery value
Day of week1-50–7range1 through 5
Next runs — browser default
Schedules are evaluated against the wall clock in the selected timezone, so a 02:30 job skips or repeats once a year when the clocks change.
Cron syntax reference
  • * — any value
  • */5 — every 5th value
  • 1-5 — a range, inclusive
  • 1,15 — a list of values
  • 9-17/2 — every 2nd value inside a range
  • L — the last day of the month
  • 1#2 — the second Monday (day-of-week field)
  • MON-FRI — month and weekday names are accepted

Como funciona

The five fields are minute, hour, day of month, month and day of week, in that order. Each accepts a single value, a list separated by commas, a range with a hyphen, or a step with a slash — so */15 in the minute field means every fifteen minutes. The asterisk is a wildcard meaning every value in the field's range. When both day-of-month and day-of-week are restricted rather than wildcards, standard cron treats them as a union: the job runs if either matches, not both. That single rule is the most common source of a job that fires more often than its author expected.

Non-standard syntax is where portability breaks down. Quartz, the Java scheduler, takes six or seven fields with seconds first and supports L for last, W for the nearest weekday and # for the nth weekday of the month. AWS EventBridge, Kubernetes CronJobs, systemd timers and Vixie cron all differ in small ways: some accept @daily and @reboot macros, some accept a six-field form with seconds, some do not support step values in every field. A parser that accepts everything will tell you an expression is valid when your target scheduler will reject it or, worse, interpret it differently.

The day-of-week numbering is its own trap. Vixie cron and most Unix implementations number Sunday as 0, so 0 and 7 both mean Sunday; Quartz numbers Sunday as 1, making the two systems off by one for every day of the week. A job scheduled with 1 expecting Monday runs on Sunday under the wrong convention, and because both are plausible the error tends to survive review. Where the names SUN, MON, TUE and so on are supported, using them removes the ambiguity entirely and should be preferred.

Daylight saving is the failure that only appears twice a year. In a timezone that shifts forward, an expression scheduled for 02:30 on the transition date refers to a time that does not exist, and implementations disagree on the response: some skip the run, some run at the shifted time, some run twice. In the autumn transition the 01:30 hour occurs twice, and a job scheduled then may run twice or once depending on the implementation. The tool flags any next-run time that falls within an hour of a transition, so the risk is visible while the expression is being written rather than after a quarterly report is missing a day.

Casos de uso comuns

  • Check what a cron expression found in a server's crontab actually does before changing it.
  • Write an expression for a nightly job and confirm the next run times land when you intend.
  • Translate a schedule requirement such as every weekday at 9am into a correct expression.
  • Diagnose a job that runs twice on one day a year — usually a daylight-saving transition.
  • Verify that an expression uses the day-of-week numbering your scheduler expects.
  • Confirm the next several run times in a colleague's timezone for a handover or an on-call rotation.

Última atualização: 2026-10-14 — o corpo do artigo é exibido em inglês; a interface está traduzida.

Perguntas frequentes

What does the fifth field mean — day of month or day of week?

The five fields in order are minute, hour, day of month, month and day of week, so the third is the day of the month and the fifth is the day of the week. The common confusion arises because both can restrict the schedule and they interact: when both are restricted, standard cron runs the job if either matches, so 0 0 13 * 5 runs on the thirteenth of the month and on every Friday. Setting one of them to a wildcard is the usual way to avoid the surprise.

Why does my job run twice or not at all on a daylight-saving change?

Because a local wall-clock time can be skipped or repeated. When clocks go forward, an expression targeting a time inside the skipped hour refers to a moment that never occurs, and the implementation either skips the run or fires it at the shifted time. When clocks go back, the same wall-clock hour occurs twice and the job may be treated as due on both occasions. Running scheduled jobs in UTC avoids the issue entirely, at the cost of the schedule no longer tracking local business hours.

What is the difference between 0 and 7 for the day of week?

Both mean Sunday in the standard Unix cron implementation, which numbers Sunday as 0 and permits 7 as a synonym. Quartz numbers Sunday as 1, so every day of the week shifts by one and an expression intended for Monday runs on Sunday. Since both conventions are in wide use and neither is self-evident, prefer the three-letter names — MON, TUE, WED — wherever the target implementation accepts them.

Does */5 in the minute field mean every five minutes?

Yes, and the general form is a step: */n means every nth value across the field's range. The subtlety is that a step starts from the beginning of the range rather than from the current time, so */7 in the minute field runs at minutes 0, 7, 14, 21 and so on, which is not the same as every seven minutes starting from whenever you happen to look. Steps combine with ranges, so 10-50/10 means minutes 10, 20, 30, 40 and 50.

Ferramentas relacionadas