Created
April 10, 2020 01:05
-
-
Save ChengzhiZhao/c8613291615b0a376b27f2214348a592 to your computer and use it in GitHub Desktop.
Airflow Scheduler Interval 101
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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