Cron Expression Interpreter

Decode Linux cron expressions into plain English.

Result
-

Understanding Cron Expression Fields

Cron expressions consist of 5 fields: minute (0-59), hour (0-23), day (1-31), month (1-12), weekday (0-6, where 0=Sunday). Special characters include: asterisk (*) means "any value", slash (/) specifies intervals (e.g., */5 = every 5 units), hyphen (-) defines ranges, and comma (,) lists multiple values. Understanding these symbols is key to creating complex scheduling rules for automated tasks.

Practical Use Cases for Cron

Cron is used for database backups, log file rotation, cache invalidation, API data pulls, and sending scheduled notifications. Developers, system administrators, and data engineers rely on cron daily. Cloud services like AWS EventBridge and Google Cloud Scheduler adopt identical cron syntax, making this knowledge universally transferable. Always validate expressions before deploying to prevent unintended server loads or missed jobs.

Common Cron Patterns

Daily at midnight: 0 0 * * * | Hourly: 0 * * * * | Mondays at 9 AM: 0 9 * * 1 | First of month: 0 0 1 * * | Noon daily: 0 12 * * * | Weekdays at 8 AM: 0 8 * * 1-5 | Every 5 minutes: */5 * * * *

Frequently Asked Questions

Q. Does weekday start at 0 or 1?

A. Weekday starts at 0 for Sunday. The scale is: 0=Sunday, 1=Monday, ..., 6=Saturday. Some systems also accept 7 for Sunday.

Q. Can I schedule tasks by seconds?

A. Standard cron operates on minute intervals only. For second-level precision, use systemd timers or other advanced schedulers instead.

Q. How do I debug a failing cron job?

A. Check crontab -l to see current jobs. Review /var/log/cron or system logs for execution records. Common issues are permission errors and missing environment variables that work in interactive shells.