What Is a Cron Expression?
A cron expression is a string of five fields that defines a schedule. It's used by Unix crontab, Kubernetes CronJobs, GitHub Actions, AWS CloudWatch, and most task schedulers.
┌───────────── minute (0-59)
│ ┌─────────── hour (0-23)
│ │ ┌───────── day of month (1-31)
│ │ │ ┌─────── month (1-12)
│ │ │ │ ┌───── day of week (0-6, 0=Sunday)
│ │ │ │ │
* * * * *The Five Fields
| Field | Values | Special Characters |
|---|---|---|
| Minute | 0-59 | `*` `,` `-` `/` |
| Hour | 0-23 | `*` `,` `-` `/` |
| Day of month | 1-31 | `*` `,` `-` `/` |
| Month | 1-12 | `*` `,` `-` `/` |
| Day of week | 0-6 | `*` `,` `-` `/` |
Special Characters Explained
*— every value ("every minute", "every hour"),— list:1,15means "1st and 15th"-— range:1-5means "Monday through Friday"/— step:*/15means "every 15"
10 Most Common Examples
* * * * * Every minute
0 * * * * Every hour (at minute 0)
0 0 * * * Daily at midnight
0 9 * * 1-5 Weekdays at 9 AM
0 0 1 * * First of every month at midnight
*/15 * * * * Every 15 minutes
0 */2 * * * Every 2 hours
30 4 * * * Daily at 4:30 AM
0 9 * * 1 Every Monday at 9 AM
0 0 * * 0 Every Sunday at midnightCommon Mistakes
1. Day of Week Numbering
Some systems use 0=Sunday, others use 1=Monday. Always check your scheduler's documentation.
2. Day of Month + Day of Week
Using both fields creates an OR condition in cron (runs if either matches), but some schedulers treat it as AND. Test before relying on this.
3. Timezone
Cron expressions don't include timezone. The schedule runs in whatever timezone the server or scheduler is configured for. Document this!
4. Missing Leading Zeros
9 and 09 are the same in cron. But 9 in month means September, not 9 AM — make sure you're in the right field.
Build Cron Expressions Visually
Cron syntax is hard to memorize. Use our [free cron expression generator](/tools/cron-expression-generator) to build expressions visually. Pick from presets, modify individual fields, and see the next 5 scheduled runs instantly.
Cron Jobs and Error Monitoring
Cron jobs fail silently. A backup script that hasn't run in 3 days? A cleanup job that's been erroring for a week? You won't know unless you monitor them.
Bugsly's cron monitoring tracks your scheduled jobs and alerts you when they miss a window or start failing. [Set up cron monitoring](/signup) in 2 minutes.
Try Bugsly Free
AI-powered error tracking that explains your bugs. Set up in 2 minutes, free forever for small projects.
Get Started FreeRelated Articles
Bugsly Integration Guide for Django
Add error monitoring to your Django app with Bugsly. Covers installation, SDK setup, and production best practices.
Read moreError Tracking Setup Should Take 5 Minutes, Not 5 Hours
A step-by-step guide to setting up error tracking in under 5 minutes for React, Python, and Node.js apps — no configuration rabbit holes.
Read moreHow to Set Up Bugsly in Ruby on Rails
Complete guide to integrating Bugsly error monitoring in your Ruby on Rails project. Get started in minutes with this tutorial.
Read moreHow to Set Up Bugsly in Astro
Add error monitoring to your Astro app with Bugsly. Covers installation, SDK setup, and production best practices.
Read more