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 | from airflow.operators import BashOperator, DummyOperator
from airflow.models import DAG
from datetime import datetime, timedelta
import pendulum
local_tz = pendulum.timezone("Asia/Shanghai")
start_date = datetime(2020, 8, 26, tzinfo=local_tz)
args = {
'owner': 'wusong',
'start_date': start_date,
'email_on_failure': False,
'email_on_retry': False,
'retries': 3,
'retry_delay': timedelta(minutes=1),
}
dag = DAG(
dag_id='testDag',
default_args=args,
schedule_interval='01 00 * * *',
dagrun_timeout=timedelta(minutes=200))
test=BashOperator(task_id="test",bash_command='cd /usr/local/airflow/dags/bi_etl/jy/;nohup python3 test.py > logs/test.txt &',dag=dag)
#yinlu_image_detial.set_downstream(yinlu_nka_image_detial)
|