The cron seconds field: the optional sixth position
An expression with six fields has a leading seconds field, detected by token count. The standard crontab daemon does not support it and treats a sixth token as the start of the command.
At a glance
- Range
- 0 to 59.
- Position
- First, when present. Every other field shifts one place right.
- How it is detected
- By counting tokens. Five means no seconds field, six means there is one.
- Field order with seconds
- second, minute, hour, day of month, month, day of week.
- System crontab support
- None. A sixth token there is read as the start of the command.
- Anything else
- Any token count other than five or six is rejected with a message naming the count.
In detail
There is no flag or marker that turns on the seconds field. The parser counts the whitespace separated tokens: five means the classic layout, and six means a seconds field has been added at the front with everything else shifted right by one. Any other count is an error rather than a guess.
That makes an accidental sixth token dangerous in a specific way. * * * * * * is a perfectly valid six field expression meaning every second, and it looks almost identical to the five field every minute expression. Reading the field breakdown, rather than counting asterisks by eye, is the reliable way to tell which one you have.
The system cron daemon does not implement seconds at all. It reads five fields and treats everything after them as the command to run, so a six field line in a crontab produces a job that runs every minute and tries to execute a program whose name is whatever the sixth token was. It will fail, but it will fail once a minute rather than at install time.
Where the seconds field does exist, it behaves exactly like the minute field: range 0 to 59, no names, steps counting from 0, and the same divisor arithmetic. */15 in the seconds field gives four runs a minute, which is 5,760 a day, and that number is worth writing down before enabling it.
Examples
*/30 * * * * *Six fields. Seconds 0 and 30 of every minute.
15 * * * * *Once a minute, but at second 15 rather than second 0.
* * * * *Every minute. Five tokens.
Things that catch people out
- A stray sixth token silently changes the meaning of every other field.
- The system crontab has no seconds field. Six fields there is a misconfiguration that runs every minute.
- Sub minute schedules produce very large run counts. */5 in the seconds field is 17,280 runs a day.
Try it: Cron Expression Parser
Paste any five or six field expression to get a plain English description, a per field breakdown and the next run times in your local time.
Cron Expression Parser
LOCAL · Browser-OnlyParse cron expressions and see the next scheduled run times
Supports 5-field (minute hour day month weekday), 6-field (with seconds), named values (JAN, MON), and @macros (@daily, @hourly, ...)
Use the dropdowns below to build your cron expression visually, or type a custom value in each field.
Human-Readable Description
Every 5 minutes
Field Breakdown
| Field | Allowed | Value | Meaning |
|---|---|---|---|
| Minute | 0-59 | */5 | every 5 minute(s) |
| Hour | 0-23 | * | every hour |
| Day of Month | 1-31 | * | every day of month |
| Month | 1-12 | * | every month |
| Day of Week | 0-7 | * | every day of week |
Related cron expressions
All cron expressions →Cron every second: * * * * * * with a seconds field
Six asterisks means every second, 86,400 times a day. Standard crontab has no seconds field, so this form only works in schedulers that accept six.
Cron every 30 seconds: */30 * * * * * and the two line trick
*/30 * * * * * fires at seconds 0 and 30, 2,880 times a day. The classic two line crontab with sleep 30 does the same thing without a seconds field.
The cron minute field: position, range and behaviour
The minute field runs 0 to 59 and is the first field in a five field expression, or the second when a seconds field is present.
Cron every 10 seconds: */10 * * * * * and the alternative
*/10 * * * * * fires 8,640 times a day at seconds 0, 10, 20, 30, 40 and 50. What to do when the scheduler only accepts five fields.
Cron day of month and day of week: the OR rule
When both date fields are restricted, cron fires if either matches, not both. This turns narrowing expressions into much wider ones without any error.
Cron name aliases: JAN to DEC and SUN to SAT
The month and day of week fields accept three letter English names, case insensitively, in single values, ranges, lists and steps.
Tools for this
- Cron Expression Parser Free online cron expression parser - parse cron expressions and see the next scheduled run times
- Crontab Generator Free online crontab generator - build cron expressions visually with an intuitive interface