0

I'm trying to figure out how to configure/schedule an Airflow DAG to run twice a day in the exact time instead of run both times at the same time once the criteria is met.

I want to run the same task at midnight and 9pm.

To do so I've added a cron to schedule_interval like 0 0,21 * * * so it runs everyday at midnight and 9pm. But today's (27th of April) run started at 00:00:00 for yesterday's (26th of April) and both 00:00:00 and 21:00:00 runs ran at the same time.

The expected behaviour would be run today (27th of April) at 00:00:00 and 21 hours later run again at 21:00:00.

Any ideas?

In the end, the question is: how can I run a DAG twice a day?

Thank you.

DennisLi
  • 3,915
  • 6
  • 30
  • 66
Hugo Sousa
  • 906
  • 2
  • 9
  • 27

1 Answers1

2

Everything you have done is correct except the start date. Keep it running for a day. Once it will backfill previous days(from start date till today) your dag should start scheduling on correct time.

Rishi Barve
  • 1,133
  • 9
  • 12