This guide provides information on reading crontab syntax for beginners. Learn about the five fields of cron, special characters, and examples of scheduling.
📌 Key Takeaways
By the end of this guide, you will know:
- ✅ The meaning of the five fields in a cron expression.
- ✅ How to quickly interpret any crontab schedule.
- ✅ The meanings of *, /, -, ,, and other special characters.
- ✅ Common scheduling examples used by Linux professionals.
- ✅ Beginner mistakes that lead to cron job failures.
- ✅ A Crontab Syntax Cheat Sheet that can be bookmarked.
Automation is a key feature in many Linux servers, cloud platforms, and web applications. Tasks such as backing up databases, restarting services, or clearing logs are often performed by Cron Jobs.
If you have opened a crontab file and seen something like this:
you might have asked yourself what these five stars mean.
You are not alone.
A common difficulty for Linux beginners is understanding how to read crontab syntax. The good news is that once the five time fields and a few special characters are understood, reading any cron schedule can become easier.
This guide will explain each part of a cron expression with clear explanations, diagrams, and real-world examples.
What Is Crontab Syntax?
A crontab, which stands for Cron Table, is a configuration file that instructs Linux when and what to execute automatically.
Every cron job follows a specific structure:
The five symbols represent the schedule while the command at the end is the task that Linux will execute.
The Five Time Fields Explained
Each cron expression consists of five scheduling fields.
These fields will be explained one by one.
1. Minute (0–59)
The first field indicates the minute.
Example:
Meaning:
Execute the command at 15 minutes past every hour.
Examples:
| Expression | Meaning |
|---|---|
| 0 | At the start of the hour |
| 15 | At 15 minutes |
| 30 | At 30 minutes |
| 45 | At 45 minutes |
2. Hour (0–23)
The second field controls the hour.
Linux operates on a 24-hour clock.
Example:
Runs daily at 2:00 PM.
Examples:
| Hour | Time |
|---|---|
| 0 | Midnight |
| 6 | 6 AM |
| 12 | Noon |
| 18 | 6 PM |
| 23 | 11 PM |
3. Day of Month (1–31)
The third field indicates which day of the month to run.
Example:
Meaning:
Execute on the 1st day of every month at 8 AM.
4. Month (1–12)
The fourth field specifies the month.
Example:
Runs daily in December.
Month values:
| Number | Month |
|---|---|
| 1 | January |
| 2 | February |
| 3 | March |
| ... | ... |
| 12 | December |
Some cron implementations allow for month names like Jan or Dec.
5. Day of Week (0–7)
The fifth field indicates the day of the week.
| Value | Day |
|---|---|
| 0 | Sunday |
| 1 | Monday |
| 2 | Tuesday |
| 3 | Wednesday |
| 4 | Thursday |
| 5 | Friday |
| 6 | Saturday |
| 7 | Sunday (supported by many implementations) |
Example:
Runs every Monday at 9 AM.
Crontab 5 Stars Explained
Many beginners look for explanations of "Crontab 5 stars."
Let's decode it.
Every star (*) represents: "Every possible value."
Thus,
means:
Run every minute of every hour of every day of every month.
This results in the command executing 1,440 times each day.
Understanding Crontab Special Characters
In addition to numbers, cron allows for special symbols that provide more flexible scheduling.
Asterisk (*)
This is the wildcard. It means: Every value.
Example:
Every hour.
Slash (/)
Indicates every interval.
Example:
Every five minutes.
Another example:
Every two hours.
Hyphen (-)
Defines a range.
Example:
Runs every hour from 9 AM to 5 PM.
Comma (,)
Specifies multiple values.
Example:
Runs at 8 AM and 8 PM.
Combining Characters
Cron expressions can combine symbols.
Example:
Meaning: Every 15 minutes between 9 AM and 5 PM, Monday to Friday.
How to Interpret Crontab Schedules
Here are some common examples decoded.
Example 1
Translation: Run daily at midnight.
Example 2
Translation: Run Monday through Friday at 6:30 AM.
Example 3
Translation: Run every four hours.
Example 4
Translation: Run at 10:15 AM on the first day of every month.
Example 5
Translation: Run every 30 minutes.
Crontab Syntax Cheat Sheet
| Expression | Meaning |
|---|---|
| * * * * * | Every minute |
| */5 * * * * | Every 5 minutes |
| 0 * * * * | Every hour |
| 0 0 * * * | Daily at midnight |
| 0 12 * * * | Every day at noon |
| 0 9 * * 1-5 | Weekdays at 9 AM |
| 0 0 1 * * | First day of every month |
| 0 0 1 1 * | Every January 1st |
| 0 2 * * 0 | Every Sunday at 2 AM |
| 30 23 * * 6 | Every Saturday at 11:30 PM |
Save this table for frequent reference.
Real-World Cron Schedules
Database Backup
Every day at 2 AM.
Clear Cache
Every 30 minutes.
Weekly Server Restart
Every Sunday at 4 AM.
Monthly Report
First day of every month at 8 AM.
SSL Certificate Renewal Check
Every day at 3 AM.
Common Beginner Mistakes
In reviewing various Linux systems, certain errors appear repeatedly:
- Mixing Up Day of Month and Day of Week – These are separate fields and can create unexpected schedules if confused.
- Forgetting the 24-Hour Clock – Cron does not recognize AM or PM. Use 13 equals 1 PM, 18 equals 6 PM, 23 equals 11 PM.
- Assuming * Means "Once" – It actually represents every possible value.
- Not Testing the Command – Before scheduling a task, run the command manually to confirm it works correctly.
- Using Relative Paths – Always use absolute paths such as /usr/local/bin/script.sh instead of script.sh.
Tips for Reading Any Cron Expression Quickly
To decode cron schedules, read them from left to right:
- What minute?
- What hour?
- Which day of the month?
- Which month?
- Which weekday?
- What command runs?
With practice, common patterns will be recognized quickly.
Use a Crontab Expression Generator
For those still learning, a Crontab Expression Generator can assist in creating valid schedules and explaining field meanings. These tools are helpful for beginners but always check the generated schedule before using it on a production server.
Final Thoughts
Learning to read crontab syntax is a valuable skill for anyone involved with Linux, DevOps, or backend infrastructure.
Once the five time fields and the meanings of *, /, -, and , are understood, interpreting almost any cron schedule can be done with assurance. As more tasks are automated, these expressions will become as familiar as basic shell commands.
Keep this Crontab Syntax Cheat Sheet bookmarked, practice with simple schedules, and feel free to experiment in a test environment. Investing time in learning cron today can reduce repetitive work in the future.
You can visit these articles too:
For authoritative information:
- Linux crontab(5) and cron(8) manual pages



