How to Build Cron Expressions

· 4 min read

Cron expressions are the standard way to define recurring schedules in Linux, cloud platforms, CI/CD pipelines, and task schedulers. The syntax is compact but not intuitive — building a visual cron generator shows you exactly when your job will run.

Cron syntax

A cron expression has 5 fields:

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

Common cron schedules

Schedule Expression Meaning
Every minute * * * * * Runs every 60 seconds
Every 5 minutes */5 * * * * At :00, :05, :10, :15...
Every hour 0 * * * * At the top of every hour
Daily at midnight 0 0 * * * Once per day at 00:00
Daily at 9 AM 0 9 * * * Once per day at 09:00
Every Monday at 8 AM 0 8 * * 1 Weekly on Monday
First of every month 0 0 1 * * Monthly at midnight on the 1st
Weekdays at 6 PM 0 18 * * 1-5 Monday through Friday

How to build a cron expression

  1. Set your schedule — use the visual controls to select minute, hour, day, month, and weekday values. Or start with a preset like "every hour" or "daily at midnight."
  2. Preview run times — the generator shows the next 5 execution times so you can verify the schedule is correct.
  3. Copy the expression — paste it into your crontab, CI/CD config, or cloud scheduler.

Special characters

Character Meaning Example
* Every value * * * * * = every minute
*/n Every nth */15 * * * * = every 15 min
, Multiple values 0 8,12,18 * * * = 8am, noon, 6pm
- Range 0 9-17 * * * = every hour 9am-5pm

Tips

Frequently Asked Questions

What is the cron expression format?

A standard cron expression has 5 fields separated by spaces, representing minute (0-59), hour (0-23), day of month (1-31), month (1-12), and day of week (0-6, where 0 is Sunday). An asterisk (*) means "every" value in that field.

What does */5 mean in cron?

The */5 syntax means "every 5th." In the minute field, */5 means every 5 minutes (0, 5, 10, 15...). In the hour field, */5 means every 5 hours. It works in any field.

Are cron expressions the same on all platforms?

The 5-field format is standard across Linux cron, AWS EventBridge, GitHub Actions, and most scheduling systems. Some platforms add a sixth field for seconds or year. Check your platform's documentation.

How do I schedule something for the last day of every month?

Standard cron does not have a "last day" keyword. Use a workaround like running daily and checking the date in your script, or use platform-specific extensions (AWS EventBridge supports L for "last").