Cron expressions look like cryptic strings, but they simply tell your server when to run scheduled tasks. If you manage a website or automate backups, reports, or email digests, understanding cron syntax helps you control your schedule. In this guide from FreeCronJob, we break down the five common fields so you can read and write cron expressions with confidence.
The Five Standard Fields
Every standard cron expression has five fields separated by spaces: minute, hour, day of month, month, and day of week. The expression "30 2 * * *" means "at 2:30 every day." The first field holds minutes (0-59), the second holds hours (0-23), and the remaining three handle calendar days. You can use lists, ranges, and step values to build flexible schedules.
Minutes and Hours
The minute field runs from 0 to 59. A value of 15 triggers a job fifteen minutes past the hour. To run every fifteen minutes, write "*/15". The hour field spans 0 to 23, using 24-hour time. A schedule of "0 6 * * *" fires at 6:00 AM. Combined, you can pick exact times like "45 14 * * *" for 2:45 PM.
Day of Month and Month
The third field sets the day of the month, from 1 to 31. The month field accepts 1-12 or abbreviations like jan, feb, and mar. An expression such as "0 9 1 * *" runs at 9:00 AM on the first day of every month, handy for monthly reports.
Day of Week
The fifth field specifies the day of the week using 0-7, where both 0 and 7 are Sunday, or abbreviations like sun, mon, and sat. To run a backup every Monday at 1:00 AM, write "0 1 * * mon". Note that day of month and day of week are both evaluated, and most tools run the job when either matches, so be cautious with combinations.
Real-World Examples
Let us look at a few schedules you might configure through FreeCronJob. The expression "*/10 * * * *" runs every ten minutes, perfect for a health check. The schedule "0 2 * * *" runs a nightly maintenance script at 2:00 AM. For a weekly newsletter, "0 8 * * mon" works well. See the FreeCronJob blog for more cron expression examples and scheduling advice.
| Purpose | Cron Expression | Meaning |
|---|---|---|
| Every minute | * * * * * | Runs at every minute |
| Every 5 minutes | */5 * * * * | Runs every five minutes |
| Daily at 3:15 AM | 15 3 * * * | Runs at 3:15 each day |
| Every Monday at 9 AM | 0 9 * * mon | Runs weekly on Monday |
| First day of month | 0 0 1 * * | Runs at midnight on the 1st |
