Your files are processed locally in your browser — never uploaded to any server.
    Back to Blog
    Developer2025-01-03Updated: April 2026

    By Productivities Team • Riyadh, Saudi Arabia

    Cron Expressions Demystified: Schedule Like a Pro

    Cron is the Unix/Linux task scheduler that has been automating system administration tasks since 1975. Today, cron expressions are used far beyond Unix — they schedule jobs in Kubernetes, AWS CloudWatch, GitHub Actions, CI/CD pipelines, and countless backend frameworks. Understanding cron syntax is essential for any developer working with automated tasks.

    The Five Fields of Cron

    A standard cron expression consists of five fields separated by spaces:

    ┌───────── minute (0-59)
    │ ┌─────── hour (0-23)
    │ │ ┌───── day of month (1-31)
    │ │ │ ┌─── month (1-12)
    │ │ │ │ ┌─ day of week (0-7, 0 and 7 = Sunday)
    │ │ │ │ │
    * * * * *

    Special Characters

    • * — matches every value ("every minute," "every hour," etc.)
    • , — lists multiple values: 1,15 means "1st and 15th"
    • - — defines ranges: 9-17 means "9 AM through 5 PM"
    • / — defines steps: */5 means "every 5 units"

    Common Cron Patterns

    • 0 * * * * — Every hour, on the hour
    • 0 9 * * 1-5 — Every weekday at 9:00 AM
    • 0 0 * * * — Midnight every day
    • 0 0 1 * * — Midnight on the 1st of every month
    • */15 * * * * — Every 15 minutes
    • 0 9,17 * * * — At 9 AM and 5 PM daily

    Cron in Modern Infrastructure

    Beyond traditional Unix crontabs, cron expressions power scheduled tasks across the modern tech stack. AWS EventBridge uses a 6-field cron with a year field. Kubernetes CronJobs use standard 5-field syntax. GitHub Actions uses cron in workflow triggers. Understanding the syntax once lets you schedule tasks everywhere.

    Common Pitfalls

    • Timezone confusion — Cron defaults to the server's timezone. Always document which timezone your cron uses.
    • Overlapping runs — If a job takes longer than the interval, you might get multiple instances running simultaneously.
    • Day-of-month + day-of-week — When both are specified, cron runs when either matches (OR logic), not both (AND logic).

    Test your cron expressions with our Cron Explainer — see the next run times and human-readable descriptions instantly.

    Share this article

    Try the tool mentioned in this article

    Cron Explainer
    Ad