0

I having trouble finding the correct cron notation in order to schedule my DAG at the third of a month but not on Sundays.

The following statement does not take the Sunday into account

schedule_interval='0 16 3 * *

Can someone help?

Lazloo Xp
  • 858
  • 1
  • 11
  • 36
  • A workaround can be something like https://stackoverflow.com/a/65786816 you will need to write your `decide` function – Elad Kalif Jul 27 '21 at 10:08

1 Answers1

1

There's unfortunately no way to express exclusions in cron.

A workaround in Airflow could be to have one task at the start which checks if the execution_date is a Sunday, and skips all remaining tasks if so.

There's an Airflow AIP (it's currently being worked on) to provide more detailed scheduling intervals: https://cwiki.apache.org/confluence/display/AIRFLOW/AIP-39+Richer+scheduler_interval, which would allow you to express this interval in future Airflow versions.

Bas Harenslak
  • 2,591
  • 14
  • 14