databricksazure-databricksjobsdatabricks-workflows

Scheduling job every other day in Azure Databricks


I need to schedule a job which will run every other day(if start is Mon then Wed, Fri, Sunday...). But in databricks job scheduler options are only for day, week, month and yearly basis.


Solution

  • The cron trigger expression consists of 6 fields separated by a space:

    1. Seconds (0 -59)
    2. minute (0 -59)
    3. Hour (0 - 23)
    4. Day of the month (1-31)
    5. Month (1-12)
    6. Day of the week (0-6, 0 = Sunday)
    7. Year (optional, default is current year)

    For the given schedule, the expression would be: 0 0 0 1/2 * ?

    This means that the schedule will run at midnight (0th sec 0th min and 0th hour) every other day (/2 in the 3rd field -- it starts on the first day then runs every 2nd day after). The 4th and 5th fields are not relevant so they are set to a wildcard ().

    To summarize, this schedule will run every other day at 12.00 AM