For the complete documentation index, see llms.txt. This page is also available as Markdown.

Cron

Overview

The Cron is a time-based system utility (time-based job scheduler) widely used in operating systems and automation platforms. Its main function is to allow tasks to be scheduled to run automatically, in the background, on specific dates, times, or time intervals. It works as a continuous time trigger that monitors the system clock to launch routines whenever the time criteria are met.

Configuration Parameters

Configuring a traditional Cron schedule is done through a text string composed of 5 required fields, separated by spaces. Each position represents a unit of time measurement:

Plaintext

 .---------------- minute (0 - 59)
 |  .------------- hour (0 - 23)
 |  |  .---------- day of month (1 - 31)
 |  |  |  .------- month (1 - 12)
 |  |  |  |  .---- day of week (0 - 6) (Sunday to Saturday)
 |  |  |  |  |
 * * * * *
  • Minutes (0 - 59): The exact minute when the task will be executed.

  • Hours (0 - 23): The time of day in 24-hour format.

  • Days (1 - 31): The numeric day of the month.

  • Months (1 - 12 or JAN-DEC): The month of the year in which the task should run.

  • Days of the Week (0 - 6 or SUN-SAT): The specific day of the week (where 0 or 7 usually represent Sunday).

Visual Cron Builder

To abstract away the complexity of the textual syntax, modern interfaces use a visual builder based on dropdown menus that map Cron parameters:

  • Fixed Value Selectors: Allow you to choose specific minutes, hours, or days (e.g., select only the minute 30 or only the month of January).

  • Interval Selectors (Steps): Make it easy to configure recurrences (e.g., choose to run every 5 minutes or every 3 months).

  • Range Selectors (Ranges): Allow you to visually define continuous periods, such as configuring an automation to run only from Monday to Friday.

Special Operators

Special operators are wildcard characters used to create advanced scheduling rules within Cron fields:

  • * (Asterisk) - Any value: Indicates that the task should run in all units of that field (e.g., * in the hours field means "all hours").

  • , (Comma) - List of values: Allows you to define multiple explicit values in a single field (e.g., 1,15 in the days field runs on days 1 and 15).

  • - (Hyphen) - Continuous range: Defines an inclusive range of values (e.g., 1-5 in the days of the week field runs from Monday to Friday).

  • / (Slash) - Steps / Increments: Specifies the repeat rate within a field, combined with the asterisk (e.g., */15 in the minutes field means "every 15 minutes").

Practical Examples

Below are the most common scheduling patterns translated into Cron expressions:

Execution Frequency

Cron Expression

Run every minute, every day

* * * * *

Run every 5 minutes

*/5 * * * *

Run at minute zero of every hour (hourly)

0 * * * *

Run once a day, exactly at midnight

0 0 * * *

Run every day at 08:30 a.m.

30 8 * * *

Run at noon, only Monday through Friday

0 12 * * 1-5

Run at midnight only on days 1 and 15 of each month

0 0 1,15 * *

Last updated

Was this helpful?