Cron Expression Generator

Client-side only

Generate cron expressions visually with our free online crontab generator. See human-readable schedule, next run times, and copy ready-to-use expressions.

Runs at 9:00 AM on Monday

Tips: * = any · */5 = every 5 · 1-5 = range · 1,15 = list

What is a Cron Expression?

Cron expressions are strings that define schedules for recurring tasks in Unix-based systems. They consist of five fields separated by spaces: minute, hour, day of month, month, and day of week. Each field accepts specific values or special characters to create flexible scheduling patterns.

Cron is used by system administrators and developers to automate tasks like backups, log rotation, database maintenance, report generation, and API calls. The cron daemon (crond) reads these expressions from crontab files and executes commands at the specified times.

Format: minute hour day month weekday command. For example, 0 2 * * * means 'run at 2:00 AM every day'. Special characters like * (any), */n (every n), - (range), and , (list) enable complex schedules.

How to Use This Tool

  1. Choose a quick preset or build your expression using the visual builder fields.
  2. Enter values for minute (0-59), hour (0-23), day (1-31), month (1-12), and weekday (0-6, where 0=Sunday).
  3. Use * for 'any value', */5 for 'every 5 units', 1-5 for ranges, or 1,15,30 for specific values.
  4. See the human-readable translation below the expression to verify your schedule.
  5. Check the 'Next 10 Run Times' to confirm when your task will execute.
  6. Click Copy to copy the expression to your clipboard, then paste it into your crontab file.

Common Use Cases

Daily Backups

Schedule database backups every night at 2 AM: 0 2 * * * /path/to/backup.sh

Log Rotation

Rotate logs weekly on Sunday at midnight: 0 0 * * 0 /usr/sbin/logrotate

Monitoring Scripts

Check server health every 5 minutes: */5 * * * * /path/to/monitor.sh

Report Generation

Generate monthly reports on the 1st at 9 AM: 0 9 1 * * /path/to/report.py

Cache Clearing

Clear application cache every hour: 0 * * * * /path/to/clear-cache.sh

Email Digests

Send weekly digest every Monday at 8 AM: 0 8 * * 1 /path/to/send-digest.sh

Frequently Asked Questions

What does * mean in cron?

The asterisk (*) means 'any value' or 'every unit'. For example, * in the minute field means 'every minute', * in the hour field means 'every hour', and so on.

How do I run a cron job every 5 minutes?

Use */5 in the minute field: */5 * * * *. This means 'every 5 minutes'. Similarly, */10 means every 10 minutes, */15 means every 15 minutes.

What does 0 0 * * * mean?

This runs at midnight (00:00) every day. The first 0 is minute, second 0 is hour, and the three asterisks mean every day, every month, and every weekday.

How do I schedule something for weekdays only?

Use 1-5 in the weekday field (Monday through Friday). Example: 0 9 * * 1-5 runs at 9 AM on weekdays only.

Can I run something on specific days like the 1st and 15th?

Yes, use a comma-separated list: 0 0 1,15 * * runs at midnight on the 1st and 15th of every month.

What's the difference between day of month and day of week?

Day of month (1-31) specifies calendar dates. Day of week (0-6) specifies weekdays (0=Sunday, 6=Saturday). If both are specified, the task runs when EITHER condition is met (OR logic, not AND).

How do I test my cron expression?

Use this tool to see the next 10 run times. You can also check your system's cron logs (typically /var/log/cron or journalctl -u cron) to verify execution.