cron
0 2 * * *Apache Airflow DAG Daily at 2 AM
“At 02:00”
Apache Airflow DAG schedule using cron preset '@daily' equivalent — runs at 2:00 AM every day. Set in your DAG definition: schedule='0 2 * * *'. Avoids peak hours for heavy data pipeline execution.
Daily1 run/day
Want to customize this schedule or validate your own cron expression?
Try it live →Field Breakdown
| Field | Value | Meaning |
|---|---|---|
| minute | 0 | 0 |
| hour | 2 | 2 |
| day | * | every day of month |
| month | * | every month |
| weekday | * | every day of week |
0
minute
2
hour
*
day
*
month
*
weekday
Lint Analysis
Info
This time may fall within a DST transition gap for some timezones. Jobs could be skipped or run twice.
Common Use Cases
- ✓Airflow ETL nightly pipeline
- ✓dbt models run via Airflow DAG
- ✓Data warehouse load nightly
- ✓ML feature engineering daily
Code Examples
Bash / crontab
# Run your script on schedule: 0 2 * * * 0 2 * * * /path/to/your/script.sh
Node.js (node-cron)
import cron from 'node-cron';
cron.schedule('0 2 * * *', () => {
console.log('Running scheduled task');
});Python (APScheduler)
from apscheduler.schedulers.blocking import BlockingScheduler
scheduler = BlockingScheduler()
@scheduler.scheduled_job('cron', minute='0', hour='2')
def my_job():
print('Running scheduled task')
scheduler.start()GitHub Actions Workflow
Generate a ready-to-use .github/workflows/schedule.yml file. Customize the name and download directly.
GitHub Actions
# .github/workflows/schedule.yml
name: Apache Airflow DAG Daily at 2 AM
on:
schedule:
- cron: '0 2 * * *'
workflow_dispatch: # allow manual trigger
jobs:
run:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Run scheduled task
run: |
echo "Running on schedule: 0 2 * * *"
# Add your commands here
Save as .github/workflows/schedule.yml in your repository root
Cron Syntax Quick Reference
| Field | Allowed Values | Special Chars |
|---|---|---|
| minute | 0–59 | * , - / |
| hour | 0–23 | * , - / |
| day of month | 1–31 | * , - / |
| month | 1–12 or JAN–DEC | * , - / |
| day of week | 0–7 or SUN–SAT | * , - / |
Special characters: *= any value ,= list -= range / = step
Related Patterns — Daily
Need to build your own cron expression from scratch?
Open the Cron Expression Builder →