DAG: pg_hsm_dashboard_dag

schedule: 00 04,09,20 * * *


pg_hsm_dashboard_dag

Toggle wrap
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
from airflow.operators.bash_operator import BashOperator
from airflow import DAG
from datetime import datetime, timedelta



args = {
    'owner': 'lidayuan',
    'start_date': datetime(2021, 11, 18),
    'email': 'gaoqiang@lenztechretail.com',
    'email_on_failure': False,
    'email_on_retry': False,
    'retries': 3,
    'retry_delay': timedelta(minutes=1),
}

dag = DAG(
    dag_id='pg_hsm_dashboard_dag',
    default_args=args,
    schedule_interval='00 04,09,20 * * *',
    dagrun_timeout=timedelta(minutes=200))



t1=BashOperator(task_id="pg_hsm_dashboard_shenhe",bash_command='cd /usr/local/airflow/dags/bi_etl/bi_project_airflow/project_common/;nohup python pg_hsm/pg_hsm_dashboard.py &',dag=dag)

t0=BashOperator(task_id="sleep",bash_command='sleep 1', retries=3 ,dag=dag)

t1.set_downstream(t0)