I am trying to run Airflow on the 2nd of every month at 11.00am, but I am failing to do so. My settings are:
default_args = {
'owner': 'airflow',
'depends_on_past': False,
'start_date': today_date,
'email': ['mymail'],
'email_on_failure': True,
'email_on_retry': True,
'retries': 1,
'retry_delay': timedelta(minutes=7),
}
dag = DAG('my_dag', default_args=default_args, schedule_interval='00 11 02 * *')
Airflow works flawlessly when I run a DAG on a daily basis:
schedule_interval='00 11 * * *'
but I don't seem to be able to make it work for a monthly basis :(
thanks!
If you want to run your dag on 2nd of every month at 11.00am. you can use this code.
schedule_interval = '0 11 2 * *'
dag_name = DAG(
'DAG_ID',
default_args=default_args,
schedule_interval=schedule_interval,
)
in the schedule interval 0 refers minute, 11 refers hour, 2 refers day of month, * refers any month, and next * refers any day of week.
for more scheduler Information check this website. https://crontab.guru/#0_11_2__
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With