@Eelke van Foeken - Thanks for the question and using MS Q&A platform.
Unfortuantely, you can’t do it in one expression. How bout splitting it to two schedules? One for First Monday of the Month.
0 0 0 ? * MON#1
and Second for Second Monday of the Month0 0 0 ? * MON#2
.
It is possible to create a schedule in Databricks that runs every two weeks on Monday night at 0:00. The cron expression you provided, "0 0 2 1,15 * ? *
", runs the job at 2:00 AM on the 1st and 15th day of every month. To modify this expression to run every two weeks on Monday night at 0:00, you can change it to "0 0 0 ? * MON#1 *
" and "0 0 0 ? * MON#2 *
".
Here is a breakdown of the expression:
- "0 0 0": This specifies the time of day as midnight.
- "?": This specifies that the day of the month is not relevant.
- "*": This specifies that the month is not relevant.
- "MON#1": This specifies that the job should run on the first Monday of every month.
- "MON#2": This specifies that the job should run on the second Monday of every month.
For more details, refer to Run jobs on a schedule or continuously and Quartz Cron Syntax.
Hope this helps. Do let us know if you any further queries.
If this answers your query, do click Accept Answer
and Yes
for was this answer helpful. And, if you have any further query do let us know.