0

Scheduling Options

  • updated 1 yr ago

When you configure the Scheduler Monitor to run the cron jobs you created you set the time at which the system should run the cron job and the interval at which they should be run. When the Scheduler runs it looks at the configured jobs and starts them as specified, using certain rules:
 

  • The cronjob scheduler does not run more concurrent cronjobs than specified
  • The cronjob scheduler does not run the same cronjob concurrently
  • The cronjob scheduler gives priority to a cronjob that is manually scheduled
  • The cronjob scheduler gives priority to a cronjob that has not run previously

Start Time

If you provide a start time only the system will run the cronjob at this specified start time. It will not start the cron job again until the start time is reached the next day. The start time is saved in the configuration file in minutes since midnight or can be configured in UTC or local time using the Cronjob Scheduler UI.

IMPORTANT NOTES when using The Cronjob Scheduler for Start Time:

  • When entering LOCAL time for a job, the system will convert this to UTC time, OR 2359 UTC time if next day.
  • When entering a Start Time whose UTC is EARLIER than now, the job will immediately run on save (as the start time for the day has passed)
  • When entering a Start Time whose UTC is LATER than now, the job will run at the designated time.

Interval

If you only specify a time interval on which the system should run the cron job the system system will start the cron job immediately after you save the configuration and will start it again if the interval (calculated based on the last start time) is passed. You must specify the interval in seconds.

IMPORTANT NOTES when using The Cronjob Scheduler for Interval:

  • When entering an interval with no start time, the job will immediately run on save
  • The job will run again after the interval (e.g. 604800 for a weekly cronjob, 86400 for a daily cronjob) but the timeing may "creep" due to other resource demands at the moment of initiation
  • We therefore recommend  using an interval WITH a start time aswell - see above for notes on use of start time

Start Time and Interval

If you configure both the start time and interval the system will start the cron job for the first time at the start time and will run it again after the interval is passed. The next day it will realign to the start time.


 

For example, if you configure a cron job with a start time of 6:00 am and an interval of 21600 (6 hours) and the cronjob itself takes around 2 hours to complete, the arrows in the image above are points in time the system should start the cron job, based on time or interval, and the blue rectangles represent the runtime of the cron jobs.


Note that the interval between 2:00am and 6:00am is not the specified 6 hours. This is the effect of ‘realigning’ to the start time.

Order of Execution

The order of execution the system uses when running cron jobs is based on the job that has been waiting the longest. job can only register itself once in the que. An example:

 
 

The arrows in the image above are the points in time when the system should start the cron job, based on start time or interval. The rectangles represent the runtime of the cron jobs. Each color represents a separately configured cron job.
 

If the system is busy with other jobs at a certain time and other cron jobs enter the queue, the system will continue executing each cron job in the order in which the cron jobs entered the queue. Note that the order of scheduling is the same as the execution order. However, also note that scheduled item 8 is not executed. This because a job can only register itself once in the queue. In this case, job 7 was already in the queue.

UTC Time Conversion

The system will convert any local time you enter to the UTC equivalent, and schedule jobs on that basis.

Depending on your specific "start time" and time zone, your local start time may actually translate to a different day (earlier/later). In this case, the UTC time will be set to the earliest/latest available time today, and may not reflect your desired event time. Check the Configured CronJobs after saving to confirm the start time is set correctly.

Note that the Scheduler Monitor can display times in either UTC or local. Toggling between the two may trigger a change based on the +/- 1 day issue above. Again, please check the Configured CronJobs start time after saving.

Reply Oldest first
  • Oldest first
  • Newest first
  • Active threads
  • Popular
Like Follow
  • 1 yr agoLast active
  • 37Views
  • 3 Following

Home