Scheduler
The Scheduler is an administrator facility for scheduling the execution rules at set intervals.
It allows to you to plan, enable, disable or run independent rules in the background, at given frequencies or times.
The Scheduler contains the following information:
-
Name - Name of the task along with the log output.
-
Status - Current status of the task.
-
Next time - The time scheduled for the next run.
-
Last time - Date and time of the last execution of the task.
-
PID - PID of the last process.
-
Description - Description of the task.
-
Frequency - Follow the format (1H - 1 hour, 1D - one day etc.).
-
Day - Indicates when the task runs only on daily days (indicated by a 1) or every day (indicated by a 0).
-
What - The name of the rule and the ID to be executed.
Scheduling Tasks¶
To schedule a new task, select the New button.
The following fields are required:
-
Name - Name of the task.
-
Rule - drop-down combo with the independent rules created in Clarive.
-
Date - Selecting this button will display a calendar field to select the desired execution date.
-
Time - Default current. Shows the system time and the arrows can increase or decrease the minutes.
-
Frequency - Format (1H - 1 hour, 1D - one day etc.).
-
Only weekdays - Checkbox to select if you want to run only on weekdays.
-
Max run time (seconds) - Optional. Maximum number of seconds the task is allowed to run. Once that time is exceeded, the scheduler kills the process and reschedules the task. Leave it empty for no limit.
Running Tasks On Demand¶
Run now¶
If you press the Run Now button, the service execution will run immediately,
regardless of the date of planning. This option is available irrespective of
the task's status.
Recovering Stuck Tasks¶
Every time the scheduler daemon wakes up, it reviews the tasks that are in
RUNNING status to make sure they are really running. This review is known as
the road kill.
A task is recovered, set back to IDLE and rescheduled when any of the
following happens:
-
The process that was running the task no longer exists.
-
The task is in
RUNNINGstatus but has no process assigned. -
The process id stored in the task was recycled by the operating system and now belongs to an unrelated process.
-
The task exceeded its Max run time, in which case the process is killed first.
Tasks that belong to a different scheduler host are never touched, so several schedulers can run at the same time without interfering with each other. Tasks with no host assigned are recovered by any scheduler, which prevents them from being stuck forever.
Each recovery fires the Scheduler Task road killed event, so it can be
notified or tracked with a rule.