Single scheduled job tries to run multiple times

Ensure your cron syntax is correct when scheduling jobs. A wildcard in the wrong space can produce unexpected results.

Written by monica.cao

Last published at: January 20th, 2023

Problem

You schedule a job (AWS | Azure | GCP) to run once per day, using Quartz Cron Syntax, but the job tries to run multiple times on the same day.

Cause

When the job was configured, it was scheduled by manually entering the cron syntax and a special character * was accidentally set for the seconds value. This tells the cron scheduler to run the job once every second.

Cron syntax specifies a time in the format <seconds> <minutes> <hours> <day-of-month> <month> <day-of-week>. Numbers are used for the values and special characters can be used for multiple values.

For example, the cron syntax * 07 04 * * ? instructs the system to attempt to start the job once every second from 04:07:00 to 04:07:59, every day.

Solution

You need to specify a value for the seconds field. By default, Databricks uses 10 for the seconds field.

By changing * to 10 in the previous example, the cron scheduler only runs the job once per day, at 04:07:10. 

For more information, review the Quartz Job Scheduler CronTrigger Tutorial documentation. 


Was this article helpful?