It would be awesome if you could share this page :)

Crontab usage

Crontab usage

Cron is a daemon program designed to perform tasks at a specific time, or at specific intervals. You can use crontab utility right from 101toolbox and edit timetable easily.

The start time is represented as follows:

minute- hour- day of month- month- weekday- generate

The CronTab tool is used to configure the execution of commands on a schedule or at a strictly appointed time. With the help of CronTab you can set a specific time, and exactly at that time the command you set will be performed. You can configure CronTab so that the task will be executed once a month, day, hour and every minute, or, for example, every 10 minutes.

  • Minutes can be from 0 to 59

  • Hours can be from 0 to 23

  • The day of the month can be from 1 to 31

  • The month can be 1 to 12

  • The day of the week can be from 0 to 7, where 0 and 7 are Sunday

You can configure CronTab to perform tasks not only in a specific time, but also every minute, hourly, daily, weekly or monthly, using combination */x․

* / 3 * * * * - run the command every three minutes

0 * / 4 * * * - run every four hours

0 10-15 * * * - run the command every hour from 10 to 15 (at 11, 12, 13, 14, and 15

0 12,16,18 * * * - run the command every hour at 12, 16 and 18 hours

The operator allows you to specify multiple values ​​in a field. Here are the main operators:

Asterisk (*): This operator specifies all possible values ​​for the field. For example, an asterisk in the Hours field will be equivalent to every hour, and an asterisk in the month field will be equivalent to every month, and so on.

Comma (,): This operator specifies a list of values, for example: "1,5,10,15,20,25".

Dash (-): This operator specifies a range of values, for example, "7-14" days, which is equivalent to "7,8,9 ... 13,14," when using the comma operator.

Slash (/): This operator specifies a step value, for example: "0-23 /" can be used in the hour field to indicate that the command has been set for every hour. Steps are also allowed after an asterisk, so there is a need to do something every two hours, you can use "*/2".