气流调度每月工作

时间:2020-11-03 02:02:49

标签: airflow airflow-scheduler

我想安排一个每月的工作,该工作每月与今天的同一天运行。我希望今天能第一次参加。例如,今天是11/2,时间是10am。我该如何安排每月工作,每月工作在2月1日上午11点进行,必须先运行11/2。

default_args = {
    'owner': 'airflow',
    'depends_on_past': False,
    'start_date': datetime(2020, 11, 1,22,00),
    'email': "myemail@abc.com",
    'email_on_failure': True,
    'email_on_success': True,
    'retries': 0
}   

def print_hello():
    today = date.today()
    print("Today's date:", today)
    return 'Hello world! Monthly Run'

dag = DAG('dummy_monthly', description='Simple tutorial DAG',
          schedule_interval='11 00 2 * *',
          start_date=datetime(2020, 11,2), catchup=False)

1 个答案:

答案 0 :(得分:0)

schedule_interval更改为00 11 2 * *