Skip to content

Instantly share code, notes, and snippets.

@marcandrewb
Last active March 3, 2024 17:51
Show Gist options
  • Save marcandrewb/eab22341c67324b28ae6a6abe4c8bdef to your computer and use it in GitHub Desktop.
Save marcandrewb/eab22341c67324b28ae6a6abe4c8bdef to your computer and use it in GitHub Desktop.
cron syntax

cron syntax

* * * * *  command to be executed
- - - - -
| | | | |
| | | | +----- Day of the week (0 - 7) (Sunday is 0 or 7)
| | | +------- Month (1 - 12)
| | +--------- Day of the month (1 - 31)
| +----------- Hour (0 - 23)
+------------- Minute (0 - 59)

Daily: Run a job every day at a specific time.

0 3 * * * # Runs at 3:00 AM every day

Weekly: Run a job on a specific day of the week.

0 4 * * 1 # Runs at 4:00 AM every Monday

Monthly: Run a job on a specific day of the month.

0 5 1 * * # Runs at 5:00 AM on the 1st day of every month

Hourly: Run a job every hour.

0 * * * * # Runs at the beginning of every hour

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment