-1

I wanted to have my dags to have first run on 2:00 AM on 25th and then onwards Tuesday to Sat daily run at 2:00 am.

following is how my scheduling look like.

with DAG(
    dag_id='in__xxx__agnt_brk_com',
    schedule_interval='0 2 * * 2-6',
    start_date=datetime(2022, 10, 24),
    catchup=False,
) as dag: 

And on Airflow UI also it shows that my first run should be on 25th 2:00 AM. But unfortunately, dags didn't execute on time.

enter image description here enter image description here

What I am missing here ?

Gaurang Shah
  • 11,764
  • 9
  • 74
  • 137

2 Answers2

0

Airflow is scheduling at 2am in your local time, that is 6am in UTC.

Take a look at this link on how to specify the timezone in your dag: https://airflow.apache.org/docs/apache-airflow/stable/timezone.html

CarlesCF
  • 195
  • 8
  • and in UTC time also, it's past `25th 2:00 AM`. it's not the timezone issue, I understand. – Gaurang Shah Oct 25 '22 at 13:52
  • 1
    Please be clear with what you expect to happen and what you are experiencing – CarlesCF Oct 25 '22 at 14:01
  • it's there as part of the question. `I wanted to have my dags to have first run on 2:00 AM on 25th and then onwards Tuesday to Sat daily run at 2:00 am` but the dag has not executed on 25th. – Gaurang Shah Oct 25 '22 at 16:05
  • Could you share more information on the DAG status, is it on pause? If you change the dag as to run inmediately, does it run? – CarlesCF Oct 26 '22 at 11:04
0

You should consult the documentation on dag intervals.

Your dag did not run on the 25th:

  • Your start date is 2022-10-24

This creates a dag interval of 2022-10-24 - 2022-10-25.

  • You set catchup=False

You created the dag after midnight on the 25th. The dag interval for the 24th has passed and you've denied catchup.

  • The next dag is scheduled for 2022-10-25

This creates a dag interval of 2022-10-25 - 2022-10-26

Your dag will run at 2am UTC on the 26th.

Daniel T
  • 531
  • 2
  • 5