Crontab Timing Format: Complete Guide with Examples

If you've ever needed to automate a task on a Linux or Unix server — running a backup every night, sending a report every Monday morning, or clearing log files every hour — you've encountered the crontab timing format. This guide explains every part of a cron expression, covers all special characters, and gives you practical, copy-paste examples for the most common scheduling needs.

When you're ready to build your own schedule visually, use our free Cron Expression Generator — it translates your expression to plain English and shows upcoming run times, all in your browser.

What is a Cron Job?

A cron job is a scheduled task managed by the cron daemon on Unix-like operating systems (Linux, macOS, BSD). The daemon reads the crontab (cron table) — a configuration file where each line defines a command and the schedule on which to run it. Cron jobs are used by developers and system administrators for:

The 5-Field Crontab Timing Format

Every cron job starts with a 5-field expression followed by the command to execute. The fields, in order, are:

*  *  *  *  *  command_to_execute
│  │  │  │  │
│  │  │  │  └── Day of week  (0–6)  │ 0 = Sunday, 6 = Saturday
│  │  │  └───── Month        (1–12)
│  │  └──────── Day of month (1–31)
│  └─────────── Hour         (0–23)
└────────────── Minute       (0–59)

Each field can hold a single value, a range, a list, a step, or the wildcard *. The table below summarizes the valid ranges:

FieldAllowed ValuesDescription
Minute0 – 59The minute of the hour
Hour0 – 23The hour of the day (24-hour clock)
Day of Month1 – 31The day of the month
Month1 – 12The month of the year
Day of Week0 – 60 = Sunday, 1 = Monday … 6 = Saturday

Crontab Special Characters Explained

Understanding the four special characters is the key to mastering the crontab timing format:

* — Wildcard (Every)

An asterisk means "every possible value" for that field. * * * * * runs the job every single minute.

/ — Step Values

The slash defines a step. */5 in the minute field means "every 5 minutes" (at 0, 5, 10, 15 … 55). */2 in the hour field means "every 2 hours".

- — Ranges

A hyphen defines a range. 9-17 in the hour field means "every hour from 9 AM to 5 PM". 1-5 in the day-of-week field means Monday through Friday.

, — Lists

A comma separates specific values. 0,15,30,45 in the minute field means "at minutes 0, 15, 30, and 45" — effectively every 15 minutes.

Crontab Schedule Examples

Here are the most common crontab schedule examples you can copy and use directly:

ExpressionMeaning
* * * * *Every minute
*/5 * * * *Every 5 minutes
*/15 * * * *Every 15 minutes
*/30 * * * *Every 30 minutes
0 * * * *Every hour (at :00)
0 */2 * * *Every 2 hours
0 */12 * * *Every 12 hours (midnight & noon)
0 0 * * *Every day at midnight
0 9 * * *Every day at 9:00 AM
0 9 * * 1Every Monday at 9:00 AM
0 9 * * 1-5Weekdays (Mon–Fri) at 9:00 AM
0 0 * * 0Every Sunday at midnight
0 0 1 * *First day of every month at midnight
0 0 1 1 *January 1st at midnight (yearly)
0 0,12 * * *Every day at midnight and noon
30 8 * * 1-5Weekdays at 8:30 AM
0 6 * * *Every day at 6:00 AM
0 23 * * *Every day at 11:00 PM

How to Edit Crontab (crontab -e)

The standard way to manage cron jobs on Linux is through the crontab -e command. Here's the full workflow:

Step 1: Open the Crontab Editor

crontab -e

This opens your personal crontab file in the system's default editor (usually nano on Ubuntu/Debian or vi on CentOS/RHEL).

Step 2: Add a Cron Job

Each line follows the format: [timing] [command]. For example, to back up a database every day at 2:00 AM:

0 2 * * * /usr/bin/mysqldump -u root mydb > /backups/mydb_$(date +\%F).sql

Step 3: Save and Exit

In nano, press Ctrl+O then Enter to save, and Ctrl+X to exit. The cron daemon automatically picks up the changes — no restart needed.

Useful Crontab Commands

CommandDescription
crontab -eEdit the crontab for the current user
crontab -lList all cron jobs for the current user
crontab -rRemove all cron jobs for the current user
crontab -u username -lList cron jobs for a specific user (root only)
sudo systemctl status cronCheck if the cron daemon is running

Common Crontab Configurations

Beyond manual scheduling, many Linux systems include predefined crontab configuration directories that run scripts automatically:

Crontab Timing Tips & Common Mistakes

Build Your Cron Expression Visually

Manually writing and verifying crontab expressions is tedious. Use our free Cron Expression Generator to:

Everything runs 100% in your browser — no data is sent to any server.

Conclusion

The crontab timing format is a powerful 5-field syntax that every Linux developer and system administrator should know. Once you understand wildcards, ranges, lists, and steps, you can automate virtually any recurring task on your server. For quick expression building without memorizing syntax, our visual Cron Generator is always available — free, private, and instant.