16 lines
458 B
Python
16 lines
458 B
Python
from airflow.operators.bash import BashOperator
|
|
import pendulum
|
|
from airflow import DAG
|
|
|
|
with DAG(
|
|
"consumption_rate_dag",
|
|
# 每月2日2点整分运行
|
|
schedule_interval="0 2 2 * *",
|
|
start_date=pendulum.datetime(2022, 7, 20, tz="Asia/Shanghai"),
|
|
catchup=True,
|
|
) as dag:
|
|
t1 = BashOperator(
|
|
task_id='consumption_rate',
|
|
bash_command='python /opt/airflow/dags/repo/dags/business/business/consumption_rate.py',
|
|
)
|
|
t1 |