Cron Expression Tester
Enter Cron Expression
Common Examples
Cron Format Reference
Field Format:
| Field | Range | Special |
|---|---|---|
| Minute | 0-59 | * , - / |
| Hour | 0-23 | * , - / |
| Day | 1-31 | * , - / |
| Month | 1-12 | * , - / |
| Weekday | 0-7 (0,7=Sun) | * , - / |
Special Characters:
*- Any value,- Value list separator-- Range of values/- Step values
Examples:
*/5- Every 5 units1,3,5- At 1, 3, and 51-5- From 1 to 510-20/2- Every 2 from 10 to 20
What is a Cron Expression?
A cron expression is a string of 5 space-separated fields that defines the schedule of an automated task on Unix/Linux systems. Each field represents a time unit: minute, hour, day of month, month, and day of week. This format, born with the Unix cron daemon in the 1970s, is now universal: it is used in Linux, macOS, web servers, CI/CD pipelines, cloud platforms (AWS, GCP, Azure), and frameworks like Symfony, Laravel, or Django. Mastering cron syntax lets you automate backups, email sending, data synchronization, or temporary file cleanup β without human intervention. This online tool lets you validate and test your cron expressions instantly, with a preview of the next scheduled executions.
What is a cron expression used for? 8 concrete use cases
Automated database backups
Schedule a nightly SQL dump at 2am to never lose your data.
Scheduled email or newsletter sending
Trigger a weekly report email every Monday morning at 8am.
Temporary file cleanup
Automatically delete old cache files or logs every Sunday.
Data synchronization between systems
Sync a product catalog with an ERP every hour via a cron task.
Periodic report generation
Automatically generate a monthly PDF report on the first day of each month.
Uptime monitoring checks
Check every 5 minutes that a URL responds correctly with a monitoring script.
Automatic SSL certificate renewal
Schedule certbot renew with a cron expression to never let a certificate expire.
Data indexing or recalculation
Relaunch an internal search engine or recalculate scores every night at 3am.
Best practices for your cron expressions
- Always use a validation tool (like this one) before deploying a cron expression to production.
- Prefer off-peak hours (2am-4am) for heavy tasks to avoid impacting your users.
- Add a timeout to your cron scripts to prevent zombie processes in case of error.
- Redirect output to a log file (
>> /var/log/myjob.log 2>&1) so you can audit executions. - Avoid
*/1 * * * *(every minute) for long-running tasks β prefer a queue system (Redis, RabbitMQ) instead.
Frequently asked questions
How many fields does a cron expression have?
What does * mean in a cron expression?
* means 'every possible value' for that field. For example, * * * * * means 'every minute, every hour, every day'.
How do I schedule a task every 15 minutes?
*/15 * * * *. The / character defines a step value: here, every 15 minutes starting from 0 (i.e., 0, 15, 30, 45).
What is the difference between 'day of month' and 'day of week'?
*), the task runs when either condition is true.
How do I run a task only on weekdays?
0 9 * * 1-5 to trigger the task at 9am from Monday (1) to Friday (5). The - defines a range of values.
Does this tool save my cron expressions?
Can cron expressions be used in Symfony?
dragonmantank/cron-expression also allow you to parse and validate cron expressions in PHP.
What is the minimum frequency of a cron job?
*/1 * * * *). For sub-minute intervals (e.g., every 10 seconds), you need an alternative solution like systemd timers, an infinite loop worker, or a message queue (Redis, RabbitMQ).