Test your cron expression (examples)


Now: 2021-07-28 13:12:00 UTC

Next times
2021-07-31 00:00:00 UTC
2021-08-01 00:00:00 UTC
2021-08-06 00:00:00 UTC
2021-08-11 00:00:00 UTC
2021-08-16 00:00:00 UTC
2021-08-21 00:00:00 UTC
2021-08-26 00:00:00 UTC
2021-08-31 00:00:00 UTC
2021-09-01 00:00:00 UTC
2021-09-06 00:00:00 UTC
2021-09-11 00:00:00 UTC

Cron is driven by a crontab (cron table) file, a configuration file that specifies shell commands to run periodically on a given schedule. On linux systems you can run the crontab -e command to edit.

Format

    # ┌───────────── minute (0 - 59)
    # │ ┌───────────── hour (0 - 23)
    # │ │ ┌───────────── day of month (1 - 31)
    # │ │ │ ┌───────────── month (1 - 12)
    # │ │ │ │ ┌───────────── day of week (0 - 6) (Sunday to Saturday;
    # │ │ │ │ │                                       7 is also Sunday on some systems)
    # │ │ │ │ │
    # │ │ │ │ │
    # * * * * *  command to execute
    

The syntax of each line expects a cron expression made of five fields, followed by a shell command to execute.

Examples

Expression Description
*/5 * * * *
Every 5 minutes show
0 */8 * * *
Every 8 hours show
1,5 * * * *
Minutes 1 and 5 of each hour show
1-5 * * * *
Minutes 1,2,3,4 and 5 of each hour show
0 2 * * *
Once a day at 2 am show
0 1 * * 1,2
Monday and Tuesday at 1 am every week show
0 0 * * 1
Every Monday at midnight show
0 0 1 * *
Day 1 of each month at midnight show
0 0 */5 * *
Every 5 days show

Cron Job Monitoring

Receive alerts if your cron jobs fail

How is it done? click here