doc/topics/cron/_index.md
Cron syntax is used to schedule when jobs should run.
You may need to use a cron syntax string to create a pipeline schedule, or to prevent unintentional releases by setting a deploy freeze.
Cron scheduling uses a series of five numbers, separated by spaces:
# ┌───────────── minute (0 - 59)
# │ ┌───────────── hour (0 - 23)
# │ │ ┌───────────── day of the month (1 - 31)
# │ │ │ ┌───────────── month (1 - 12)
# │ │ │ │ ┌───────────── day of the week (0 - 6) (Sunday to Saturday)
# │ │ │ │ │
# │ │ │ │ │
# │ │ │ │ │
# * * * * * <command to execute>
(Source: Wikipedia)
In cron syntax, the asterisk (*) means 'every,' so the following cron strings
are valid:
0 * * * *0 0 * * *0 0 * * 00 0 1 * *0 0 22 * *0 0 1 1 *0 3 1,15 * *For complete cron documentation, refer to the
crontab(5) Linux manual page.
This documentation is accessible offline by entering man 5 crontab in a Linux or MacOS
terminal.
Additionally, GitLab uses fugit, which
accepts # and % syntax. This syntax might not work in all cron testers:
0 0 * * 1#2. This syntax is from the fugit hash extension.0 9 * * sun%2. This syntax is from the fugit modulo extension.# Run at 7:00pm every day:
0 19 * * *
# Run every minute on the 3rd of June:
* * 3 6 *
# Run at 06:30 every Friday:
30 6 * * 5
More examples of how to write a cron schedule can be found at crontab.guru.
GitLab uses fugit to parse cron syntax
strings on the server and cron-validator
to validate cron syntax in the browser. GitLab uses
cRonstrue to convert cron to human-readable strings
in the browser.