If you are working with Apache Airflow, Linux, automation, or data pipelines, you will eventually encounter cron expressions.
At first, something like this can look confusing:
00 3 * * 1-7
But once you understand what each part represents, cron schedules become very easy to read and create.
In this article, we will break down the cron expression 00 3 * * 1-7, explain each component, and show how it is used in Airflow.
What Is a Cron Expression?
A cron expression is a format used to define when a scheduled task should run.
Cron is commonly used in:
- Linux and Unix systems
- Apache Airflow
- Data engineering pipelines
- Database jobs
- ETL and ELT processes
- Backup automation
- Application maintenance
- Server monitoring
A traditional cron expression contains five fields:
┌───── Minute
│ ┌─── Hour
│ │ ┌─ Day of month
│ │ │ ┌─ Month
│ │ │ │ ┌─ Day of week
│ │ │ │ │
00 3 * * 1-7
Each field tells the scheduler a different part of the schedule.
Understanding 00 3 * * 1-7
Let's break it down:
00 3 * * 1-7
| Field | Value | Meaning |
|---|---|---|
| Minute | 00 |
At minute 0 |
| Hour | 3 |
At 3 AM |
| Day of month | * |
Every day |
| Month | * |
Every month |
| Day of week | 1-7 |
Monday through Sunday |
Therefore:
00 3 * * 1-7means run the task every day at 3:00 AM.
1. The Minute Field - 00
The first field represents the minute.
00
This means the task runs at minute zero.
For example:
3:00 AM
4:00 AM
5:00 AM
If you used:
30
instead, the task would run at:
3:30 AM
So:
00 3
means:
At exactly 3:00.
2. The Hour Field - 3
The second field represents the hour.
3
This means 3 AM.
Combined with the first field:
00 3
we get:
3:00 AM.
For example:
00 1
means 1:00 AM.
00 6
means 6:00 AM.
30 18
means 6:30 PM.
Cron generally uses the 24-hour clock, so:
3 = 3 AM
12 = 12 PM
15 = 3 PM
18 = 6 PM
23 = 11 PM
3. Day of Month - *
The third field represents the day of the month.
*
The asterisk means:
Every possible value.
Therefore:
*
in this position means every day of the month:
1
2
3
4
...
31
This means there is no restriction based on the date.
4. Month - *
The fourth field represents the month.
Again, we have:
*
This means:
Every month.
Therefore, the schedule applies to:
January
February
March
April
...
December
There is no restriction on the month.
5. Day of Week - 1-7
The final field represents the day of the week.
1-7
The range means Monday through Sunday.
Typically:
1 = Monday
2 = Tuesday
3 = Wednesday
4 = Thursday
5 = Friday
6 = Saturday
7 = Sunday
Therefore:
1-7
means:
Every day of the week.
So the entire expression:
00 3 * * 1-7
means:
Run every day at 3:00 AM.
Cron Schedule Examples
Understanding a few examples makes cron much easier.
Every day at 3:00 AM
00 3 * * *
Meaning:
Run every day at 3:00 AM.
You could also write:
00 3 * * 1-7
Both express a daily schedule.
Every day at 6:30 AM
30 6 * * *
Meaning:
Run every day at 6:30 AM.
Every Monday at 3:00 AM
00 3 * * 1
Meaning:
Run every Monday at 3:00 AM.
Every Friday at 5:00 PM
00 17 * * 5
Meaning:
Run every Friday at 5:00 PM.
Every hour
00 * * * *
Meaning:
Run at minute 0 of every hour.
For example:
1:00
2:00
3:00
4:00
...
Every 15 minutes
*/15 * * * *
Meaning:
Run every 15 minutes.
For example:
12:00
12:15
12:30
12:45
1:00
Using Cron Expressions in Apache Airflow
Cron expressions are particularly useful in Apache Airflow because they allow you to control when DAGs should run.
For example:
from airflow import DAG
dag = DAG(
dag_id="daily_pipeline",
schedule="00 3 * * *",
)
This tells Airflow to schedule the DAG:
Every day at 3:00 AM.
You may also encounter:
schedule="00 3 * * 1-7"
This explicitly specifies Monday through Sunday.
In this particular case, however, the simpler:
schedule="00 3 * * *"
is easier to read because the * already means every day of the week.
Be Careful With Timezones in Airflow
One of the most important things to understand when working with Airflow schedules is the timezone.
Suppose your Airflow environment uses UTC.
If your DAG is scheduled for:
03:00 UTC
and you are working in Kenya, which uses East Africa Time (EAT), that corresponds to:
06:00 AM EAT
So if your intention is:
Run the pipeline at 3:00 AM Kenya time
you need to make sure your Airflow DAG and environment are configured with the appropriate timezone.
This is especially important for data engineering teams working across countries and regions.
Why Cron Expressions Matter in Data Engineering
Cron schedules are commonly used to control the execution of data pipelines.
For example, imagine you have a pipeline that:
- Extracts data from a source database
- Loads the data into a data lake
- Transforms the data using dbt
- Updates a data warehouse
- Makes the data available for reporting
You might schedule the pipeline to run every morning:
00 3 * * *
The pipeline would then be triggered every day at 3:00 AM.
This is particularly useful when data needs to be processed before business users start working in the morning.
A Simple Way to Read Cron
Whenever you see a cron expression, read it from left to right:
MINUTE
HOUR
DAY OF MONTH
MONTH
DAY OF WEEK
For:
00 3 * * 1-7
you can translate it mentally as:
00 -> minute 0
3 -> hour 3
* -> every day
* -> every month
1-7 -> Monday to Sunday
Then combine everything:
Every day at 3:00 AM.
Quick Cron Cheat Sheet
| Cron | Meaning |
|---|---|
00 3 * * * |
Every day at 3:00 AM |
00 3 * * 1 |
Every Monday at 3:00 AM |
00 3 * * 1-5 |
Monday to Friday at 3:00 AM |
00 3 * * 1-7 |
Every day at 3:00 AM |
30 6 * * * |
Every day at 6:30 AM |
00 12 * * * |
Every day at noon |
00 18 * * 5 |
Every Friday at 6:00 PM |
*/15 * * * * |
Every 15 minutes |
00 * * * * |
Every hour |
00 0 1 * * |
First day of every month at midnight |
Final Takeaway
The cron expression:
00 3 * * 1-7
means:
Run every day of the week at exactly 3:00 AM.
The five cron fields are:
00 3 * * 1-7
│ │ │ │ │
│ │ │ │ └── Day of week
│ │ │ └───────── Month
│ │ └────────────── Day of month
│ └─────────────────── Hour
└───────────────────────── Minute
Once you understand these five fields, you can read most basic Linux cron and Apache Airflow schedules without having to memorize them.













