← Back to Tools

Cron Expression Generator

Build cron schedules visually

* * * * *

Runs every minute

Free Cron Generator - Create cron expressions visually without memorizing syntax. Select minute, hour, day, month, and weekday. Get instant human-readable description. Copy expressions for cron jobs, scheduled tasks, and automation.

How It Works - Choose values for each field. The expression updates instantly. Click Copy to use in crontab, cron services, or task schedulers.

Cron Syntax Guide

A cron expression has five fields separated by spaces: minute hour day-of-month month day-of-week. Each field accepts a number, * (every), */n (every n units), a range like 1-5, or a list like 1,3,5. Minute runs 0-59, hour 0-23, day-of-month 1-31, month 1-12, and day-of-week 0-6 (Sunday is 0 or 7).

Common Cron Examples

Frequently Asked Questions

What is cron?

Cron is a time-based job scheduler on Unix systems. Expressions define when tasks run.

What do the 5 fields mean?

Minute (0-59), Hour (0-23), Day of month (1-31), Month (1-12), Day of week (0-6).

What does * * * * * mean?

Runs every minute. First * = every minute, second = every hour, etc.

How do I schedule a task to run every Monday at 9 AM?

Use the expression 0 9 * * 1. Set minute to 0, hour to 9, day-of-month to every day, month to every month, and day-of-week to Monday (1). This is one of the most common cron schedules for weekly reporting jobs.

Can I use cron on Windows?

Windows does not have a native cron daemon. However, you can use Task Scheduler, or install tools like Cron for Windows, Cygwin, or WSL (Windows Subsystem for Linux) which provide full cron support. The cron expressions generated here work in all Unix-compatible environments.

What is the difference between * and */5 in cron?

The asterisk * means every possible value in that field. For example, * in the minute field runs at every minute (0, 1, 2, ..., 59). The notation */5 means every 5th value — so */5 in minutes runs at 0, 5, 10, 15, etc. It is a shorthand for a step value that divides the range evenly.

What do the 5 fields in crontab mean?

The five fields are: minute (0-59), hour (0-23), day of month (1-31), month (1-12), and day of week (0-7, where both 0 and 7 represent Sunday). This format is standard across Unix-like systems including Linux, macOS, and BSD.

How do I run a cron job every 5 minutes?

Use the expression */5 * * * *. The */5 means "every 5th value" in the minute field. This is equivalent to specifying 0,5,10,15,...,55 in the minute field.

Can I schedule a task for multiple specific times?

Yes! Use commas to separate values. For example, 0 9,12,15 * * * runs at 9 AM, 12 PM, and 3 PM every day. You can also use ranges like 0 9-17 * * * to run every hour from 9 AM to 5 PM.

What's the difference between * and */n in cron?

The asterisk * means "every possible value". For minute field, this means 0,1,2,...,59. The slash notation */n means "every nth value". So */15 in minute field means 0,15,30,45. Use step values to control frequency.

How do I run a task on the first day of every month?

Use 0 0 1 * *. This sets minute=0, hour=0 (midnight), day-of-month=1, every month, every day-of-week. The task runs at 00:00 on the 1st day of each month.

Why is my cron job not running?

Common issues: (1) Wrong path — cron has minimal PATH, use absolute paths. (2) Permissions — make sure the script is executable. (3) Environment — cron doesn't load your shell profile. (4) Syntax — check /var/log/cron or journalctl -u cron for errors. (5) Newline — crontab requires a newline at the end of the file.

How do I schedule a task for weekdays only (Monday-Friday)?

Use 0 9 * * 1-5. The 1-5 in the day-of-week field means Monday through Friday. This is perfect for daily reports, backups, or reminders during workdays only.

What does @reboot mean in crontab?

@reboot is a special string that runs a command once at system startup. Example: @reboot /path/to/script.sh. Note: This only works if the cron daemon starts after reboot, which is standard on most Linux distributions.

How do I run a task at 8 AM on the 15th of every month?

Use 0 8 15 * *. This runs at 08:00 on the 15th day of every month. You can combine this with day-of-week restrictions for more complex schedules.

Can I use cron to run a task every 90 minutes?

Not directly with standard cron syntax. However, you can use two lines: 0 0,3,6,9,12,15,18,21 * * * and 30 1,4,7,10,13,16,19,22 * * *. Or use a systemd timer with OnUnitActiveSec=90min for more flexibility.

How do I log the output of a cron job?

By default, cron emails the output to the user. To log to a file, redirect output: 0 * * * * /path/to/script.sh >> /tmp/cron.log 2>&1. The 2>&1 redirects stderr to stdout, so both are logged.

What's the difference between cron and anacron?

Cron assumes the system runs 24/7 and runs tasks at specific times. Anacron is for systems that don't run continuously (like laptops). Anacron ensures tasks run periodically even if the system was off at the scheduled time. Use cron for servers, anacron for desktops/laptops.

How do I edit my crontab?

Use crontab -e to edit your user crontab. This opens the crontab in your default editor (set by $EDITOR). To list current cron jobs, use crontab -l. To remove all cron jobs, use crontab -r (be careful!).

Can I use cron expressions in Kubernetes CronJobs?

Yes! Kubernetes CronJobs use standard cron format. Example: schedule: "0 0 * * *" runs daily at midnight. Note: Kubernetes adds a 6th field for seconds at the beginning, but the CronJob spec uses standard 5-field cron.

Why use this cron generator instead of writing expressions manually?

Manual cron syntax has a steep learning curve. Common mistakes include: forgetting that day-of-week is 0-6, mixing up hour and minute fields, and incorrect step values. This tool generates correct expressions instantly, explains what they do, and helps you learn cron syntax through practice. It's perfect for both beginners and experienced developers who want to save time and avoid errors.

📋 Common Cron Examples

Here are the most frequently used cron expressions. Copy and adapt them for your own scheduled tasks.

0 2 * * * → Every day at 2:00 AM (backup jobs)
0 */2 * * * → Every 2 hours (monitoring)
30 8 * * 1-5 → 8:30 AM, Monday-Friday (workday reminder)
0 0 1 * * → Midnight on the 1st of every month (monthly report)
0 12 * * 0 → Noon every Sunday (weekly cleanup)
*/15 * * * * → Every 15 minutes (frequent sync)
0 9-17 * * 1-5 → Every hour 9AM-5PM, weekdays (business hours)
0 0 * * 0 → Midnight every Sunday (weekly reset)
0 4 1,15 * * → 4:00 AM on the 1st and 15th (bi-monthly)

Tip: After generating your cron expression, test it with croniter or online validators before deploying to production.

Cron Best Practices

Quick Reference