Scheduling capabilities of the administrative task scheduler
The administrative task scheduler can execute a task once or many times, at fixed points in time, or in response to events.
Five parameters define the scheduling behavior of the task, in one of four ways:
- interval: elapsed time between regular executions
- point-in-time: specific times for execution
- trigger-task-name alone: specific task to trigger execution
- trigger-task-name with trigger-task-cond and trigger-task-code: specific task with required result to trigger execution
Only one of these definitions can be specified for any single task. The other parameters must be null.
Parameter specified | Required null parameters |
---|---|
interval | point-in-time
trigger-task-name trigger-task-cond trigger-task-code |
point-in-time | interval
trigger-task-name trigger-task-cond trigger-task-code |
trigger-task-name alone | interval
point-in-time trigger-task-cond trigger-task-code |
trigger-task-name with trigger-task-cond and trigger-task-code | interval
point-in-time |
If interval, point-in-time, trigger-task-name, trigger-task-cond, and trigger-task-code are all null, max-invocations must be set to 1.
You can restrict scheduled executions either by defining a window of time during which execution is permitted or by specifying how many times a task can execute. Three parameters control restrictions:
- begin-timestamp: earliest permitted execution time
- end-timestamp: latest permitted execution time
- max-invocations: maximum number of executions
The begin-timestamp and end-timestamp parameters are timestamps that define a window of time during which tasks can start. Before and after this window, the task will not start even if the schedule parameters are met. If begin-timestamp is null, the window begins at the time when the task is added, and executions can start immediately. If end-timestamp is null, the window extends infinitely into the future, so that repetitive or triggered executions are not limited by time. Timestamps must either be null values or future times, and end-timestamp cannot be earlier than begin-timestamp.
For repetitive or triggered tasks, the number of executions can be limited using the max-invocations parameter. In this case, the task executes no more than the number of times indicated by the parameter, even if the schedule and the window of time would require the task to be executed. Executions that are skipped because they overlap with previous executions that are still running are not counted toward max-invocations.
The max-invocations parameter defines a limit but no requirement. If the task is executed fewer times than indicated during its execution window, the maximum number of executions will never be reached.