Skip to content

Instantly share code, notes, and snippets.

@ChengzhiZhao
Created April 10, 2020 01:05
Show Gist options
  • Save ChengzhiZhao/c8613291615b0a376b27f2214348a592 to your computer and use it in GitHub Desktop.
Save ChengzhiZhao/c8613291615b0a376b27f2214348a592 to your computer and use it in GitHub Desktop.
Airflow Scheduler Interval 101
from airflow.models import DAG
from datetime import datetime, timedelta
from airflow.operators.bash_operator import BashOperator
args = {
'owner': 'Airflow',
'start_date': datetime(2020, 4, 1),
'depends_on_past': True,
}
dag = DAG(
dag_id='scheduler_interval_101',
schedule_interval='0 2 * * *',
default_args=args,
tags=['example']
)
hello_my_task = BashOperator(
task_id='hello_task',
bash_command='echo "hello_world"',
dag=dag,
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment