*any value
,delimiter for list of values
-range of values
/step values
0-59allowable values
*any value
,delimiter for list of values
-range of values
/step values
0-23allowable values
*any value
,delimiter for list of values
-range of values
/step values
1-31allowable values
*any value
,delimiter for list of values
-range of values
/step values
1-12allowable values
*any value
,delimiter for list of values
-range of values
/step values
0-7allowable values

Cron calculator is a handy tool that helps users and system administrators to easily and quickly create and check schedules for Cron jobs. Cron is a task scheduler in Unix-like operating systems that allows scripts and commands to be automatically executed at specified times.

Cron is used to automate the execution of tasks such as backups, sending email reports, cleaning up temporary files, and more. Each Cron task is specified with a string containing information about when and how often the task should be executed.

Why do you need a cron Calculator?

  • Simplifying customization: Creating Cron strings can be complicated for beginners. The calculator helps to avoid mistakes when entering schedules.
  • Schedule visualization: The calculator provides a graphical representation of the schedule, allowing you to better understand exactly when a task will be performed.
  • Popular cron templates: A list of frequently used launch ranges.

Syntax

The schedule specifies parameters separated from each other by a space. The first five parameters specify the frequency of task execution, and the last one is the command to be run by cron:

  * * * * * <команда>
# | | | | |
# | | | | день недели (0–7) (0 и 7 - воскресенье)
# | | | месяц (1–12)
# | | день месяца (1–31)
# | час (0–23)
# минута (0–59)

Important! If you specify the day of the week and the day of the month at the same time, the OR condition will be used. many people expect that the task * * * * 1 2 will be executed only if the first day is Tuesday, but in reality the task will be executed both on the 1st day and every Tuesday;  

Each of the parameters can contain digits indicating when the cron task should be executed. In addition to numbers, special characters are used:

  • An asterisk ( * ) indicating "any value". For example * * * * * * * — run a cron task every minute, * * * * * * 1 — run a cron task every minute on Mondays.
  • Comma ( , ) — used to specify multiple values in a task schedule. For example: * * * * * * * 1,2,3 — perform a task every minute on Mondays, Tuesdays and Wednesdays.
  • Hyphen ( — ) — used to indicate intervals. For example: * * * * * * * 1-5 — perform the task every minute from Monday through Friday.
  • The division sign ( / ) — gives the possibility to specify the task start interval. For example: */5 * * * * * * — crontab task execution every 5 minutes. But it should be noted that the specified interval is calculated only within one hour. So if you specify */31 * * * * * — then the task will be executed not every 31 minutes (00:31, 01:02, 02:33 ....), but only once an hour in 31 minutes (00:31, 01:31, 02:31 ...) as every hour the counter will be reset. The same rule applies to hours and days. For this reason, it is recommended to specify a startup frequency that is a multiple of the number of minutes, hours or days. For minutes it is */2, */5, */10, */12, */15, */20, i.e. values that divide 60 minutes without a remainder. For hours it is */2, */3, */4, */6, */12 i.e. any value that divides 24 by a number without a remainder.