DAG: HPTL_INFO

schedule: 5 * * * *


HPTL_INFO

Toggle wrap
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
from airflow.operators.bash_operator import BashOperator
from airflow.models import DAG
from datetime import datetime, timedelta
args = {
    'owner': 'daejeon_admin',
    'start_date': datetime(2020, 3, 25)
}
dag = DAG(
    dag_id='HPTL_INFO',
    default_args=args,
    schedule_interval="5 * * * *")
# Bash Operator
cmd = 'echo "t1 `date`" >> /home/nlpmonster/airflow/test.log'
t1 = BashOperator(task_id='t1', bash_command=cmd, dag=dag)

# Bash Operator
cmd = 'echo "t2 `date`" >> /home/nlpmonster/airflow/test.log'
t2 = BashOperator(task_id='t2', bash_command=cmd, dag=dag)
t1 >> t2