Schedule when not to run

Paul Watson (101 posts)
May 27, 2015 09:59 AM
Accepted Answer

We are using adTempus 3.0.8.1

We have a job that will run once per hour looking for work to do. When it does find work to do, it will run anywhere from 15 minutes to 3 hours. Our system has a regularly scheduled maintenance window on Saturdays from 09:00 to 12:00.

I have used schedules successfully to trigger (start) jobs. In this case, I need a schedule that will trigger a job once per hour EXCEPT for Saturdays from 06:00 to 13:00 in order to avoid the maintenance window.

Is it possible with adTempus 3.0.8.1 to create such a "conditional" schedule?

Bill Staff (599 posts)
May 27, 2015 03:48 PM
Accepted Answer

There is no way to do exclusion schedules in current versions of adTempus. This is in the plans for version 5.

If you are only dealing with one job, the easiest way to accomplish this is to have two schedules on your Schedule Trigger. Have the first schedule configured to run once an hour on every day except Saturday. Have the second schedule configured for Saturday only, and set it to trigger at the specified times (00:00, 01:00, etc.), skipping the 06:00 - 13:00 range.

In scenarios when you need to prevent many or all jobs from running during a certain period, it's not practical to configure them all this way. There are other approaches that can be used for those cases, such as:

  • Give every job an exclusion condition on a file that is only present during the maintenance window.
  • Give every job a Script Condition that calls a Shared Script that looks at the current day/time and blocks job execution during the maintenance window.
  • Give every job an exclusion condition on a Job Variable and running jobs to set/clear that variable at the start/end of the maintenance window.
  • Run a job at the beginning of the maintenance window that uses the API to place all queues on hold, and another job at the end of the window to release them (the start/end jobs run in a separate queue that doesn't get held).

Unfortunately all but the last approach have the drawback that they require each job to be properly configured with a Condition.

Paul Watson (101 posts)
May 27, 2015 06:37 PM
Accepted Answer

I like the last approach, Bill. I see references to C++, C#, and VB; none of which are currently in use here. Could this be done with a .vbs script? If Perl can do .NET, could Perl be used?

The easy route would be the first method. Since we have a small number of triggered tasks, we could change them all. The other jobs will not be run unless one of the triggered jobs runs or if we manually shoot ourselves in the foot.

Bill Staff (599 posts)
May 28, 2015 10:16 AM
Accepted Answer

The adTempus 3 API can be used with any development environment that supports ActiveX or .NET. This includes VBScript and Perl. You could also use PowerShell.

The adTempus 4 API drops ActiveX support and requires .NET support.

Rather than VBScript you would be better off building a VB.NET script using the adTempus script editor/script engine.

Paul Watson (101 posts)
May 28, 2015 10:40 AM
Accepted Answer

The adTempus script editor/script engine sound like the best way to go.

Not to worry, I will not be developing anything for ActiveX.

I have to admit that if Microsoft's taunts of .NET running on non-Windows systems are anything more than vendor lock-in back to Windows, learning it might be useful someday. Like most vendors, there's always a caveat with Microsoft.

Replies are disabled for this topic.