webCOMAND

Scheduled Task Model

  • Namespace: io_comand_systemtask\models
  • Extends: cObject

Defines when and how a task should be run and monitored.

Scheduled Tasks that are currently running, or previously ran can be accessed from the webCOMAND UI Notifications & Tasks sidebar, where their progress and logged events can be viewed.

Properties

  • Title - Name of the Scheduled Task, as it will appear in the Notifications & Tasks sidebar and CLI.
  • User - Optional user to initiate this scheduled task as. This is not necessarily the same as the user who the task will run as.
  • Email - If set, the system will email the task status and event log to the user who initiated this scheduled task or the Email To recipients, when the selected condition is met.
  • Email To - An optional comma-separated list of users to email status and events to in this scheduled task, instead of to the User who initiated this scheduled task.  For example: person1@email.com, John Smith <person2@email.com>
  • Retries - The number of times this scheduled task should be repeated in the event that a failure occurs (that is, when an "Unexpectedly Terminated" process status is encountered). 0 indicates that the task will not be retried (the default), 1 indicates that it will be retried once, etc.
  • Timeout - If set, and if an 'On Timeout' action is selected, this is the number of seconds after which the 'On Timeout' action will be taken. 0 implies that the process will never timeout.
  • On Timeout - If set, and if a non-0 'Timeout' is defined, this action will be taken when the process execution exceeds 'Timeout' seconds. Processes that are canceled or killed for exceeding their max runtime will not be automatically retried.
  • Runnables - The runnable content to invoke for this scheduled task.
  • Parameters - The JSON array of parameters to use in this scheduled task. This array's length should be exactly equal to the number of selected Runnables, and holding at each index an associative or non-associative array of parameters to pass in to each Runnable respectively. For example, for two runnables:
    [
        {
            "param1": "associative parameters",
            "param2": "for the first Runnable"
        },[
            "non-associative parameters",
            "for the second Runnable"
        ]
    ]
  • Retention - The amount of time, in hours, that SystemTasks generated from this ScheduledTask should be left in the system before they are automatically purged. If 0, they are never removed.
  • Active - The scheduled task will only be run if marked as active.
  • Server Types - The server types that this task will be able to run on. The configured webCOMAND server_type value will be compared to this field, and only tasks matching the server type will be able to be run.  Examples:
    • <blank>: runs on any server type
    • production: runs on any production server
    • production, development: runs on any production OR development server
    • !failover: runs on any server that is not a failover
    • !failover, !development: runs on any server that is not a failover and is not a development server
  • Groups - A comma-separated list of group names that this task is associated with. Groups defined here are used in conjunction with BlockedBy to queue tasks that shouldn't run at the same time as one-another.
  • Blocked By - A comma-separated list of groups that this task will be blocked by. This task will not start if other tasks with these groups are already running. '*' can also be used to be blocked by any other running tasks.
  • Run As Service - When checked, this task will be run as a service and always available in the background. No scheduled times will be required because the daemon will always ensure that this is running.
  • Schedule - The set of schedule times that define when this task should be run.