Skip to content

Custom Crontab Tasks

A Crontab expression is a string used to configure scheduled tasks, consisting of five or six fields that represent minutes, hours, days, months, weekdays, and optionally, years. Each field uses numbers and can employ specific symbols to specify value ranges or steps.

You can input Crontab syntax at Guance Threshold Detection > Detection Frequency. The basic format is: minute hour day month weekday.

Value Range Explanation

  • Minute: 0 - 59, indicating the minute of the hour;

  • Hour: 0 - 23, indicating the hour of the day;

  • Day: 1 - 31, indicating the day of the month;

  • Month: 1 - 12, indicating the month of the year;

  • Weekday: 0 - 6, indicating the day of the week, where 0 represents Sunday.

Special Characters

Includes - * / ,:

  • *: Can be any value, for example, * * * * * means executing every 1 minute;

  • -: Value range, for example, 0-10 * * * * means executing every 1 minute only from the 0th to the 10th minute of each hour;

  • /: Step definition, the value before / represents the starting minute, and the value after / represents the interval. For example, */10 * * * * means executing every 10 minutes;

  • ,: Multiple value specification, separated by commas. For example, 0,3,12,18 * * * * means executing only at the 0th, 3rd, 12th, and 18th minutes of each hour.

Crontab Examples

* * * * *: Execute the scheduled task every minute

0 * * * *: Execute the scheduled task every hour at the 0th minute

0 0 * * *: Execute the scheduled task every day at 0:00

0 0 1 * *: Execute the scheduled task every month on the 1st at 0:00

0 0 1 1 *: Execute the scheduled task every year on January 1st at 0:00

0 0 * * 0: Execute the scheduled task every Sunday at 0:00

0-10 * * * *: Execute the scheduled task every minute from the 0th to the 10th minute of each hour

*/10 * * * *: Execute the scheduled task every 10 minutes

0,3,12,18 * * * *: Execute the scheduled task at the 0th, 3rd, 12th, and 18th minutes of each hour

Feedback

Is this page helpful? ×