Version

    2. Scheduling

    The scheduling module allows you to create a time schedule for operations you need to trigger in a repetitive or timely manner.

    Similar to cron from Unix systems, each schedule represents a separate time schedule definition and a task to perform.

    In the left pane of the Scheduler GUI, you can see the status of schedules, details, date and time of last/next run and three-dot button with actions: Run Now, Edit, Show in the Task History, Disable and Delete. The right pane shows time line and details of the selected schedule.

    If the server is suspended, action Run Now requires explicit confirmation of execution on suspended server.

    Note that if a schedule is failing, you can see the error message in the right pane and there is an additional action available: Clear Failure Indication. When selecting this action, the schedule is no longer indicated as failing. It acts as if it were never run, but its timeline is still visible in the detail pane. This function is useful when you fix a failing schedule with a long interval between runs and by resetting the state, you mark the schedule as OK. This way, it doesn’t cause distraction by being shown as failing until its status is refreshed in the next run.

    scheduling 010
    Figure 9. Web GUI - Scheduling

    Tasks you can schedule are described in Tasks.

    Send an email

    Execute shell command

    Start a graph

    Start a jobflow

    Start a library health check job

    Abort job

    Archive records

    Send a JMS message

    Execute Groovy code

    Timetable setting

    This section describes specification of triggering schedules. Note that exact trigger times are not guaranteed. There may be couple of seconds delay. Schedule itself can be specified in different ways.

    Onetime schedule

    Periodical schedule by interval

    Periodical schedule by timetable (cron expression)

    Onetime schedule

    This schedule is triggered just once.

    Table 14. Onetime schedule attributes
    Name Description

    Periodicity

    Onetime

    Start time

    Date and time, specified in the yyyy-mm-dd hh:mm:ss format.

    Start skipped executions as soon as possible

    If checked and execution is skipped for any reason (e.g. server restart), it will be triggered immediately when it is possible. Otherwise it is ignored and it will be triggered at the next scheduled time.

    formScheduleOnetime
    Figure 10. Web GUI - onetime schedule form

    Periodical schedule by interval

    This type of schedule is the simplest periodical type. Trigger times are specified by these attributes:

    Table 15. Periodical schedule attributes
    Name Description

    Periodicity

    Interval

    Run every

    Specifies interval between two trigger times (in minutes). The next task is triggered even if the previous task is still running.

    Active from/to

    Date and time, specified in the yyyy-mm-dd hh:mm:ss format.

    Start skipped executions as soon as possible

    If checked and execution is skipped for any reason (e.g. server restart), it will be triggered immediately when it is possible. Otherwise it is ignored and it will be triggered at the next scheduled time.

    formSchedulePeriodicInterval
    Figure 11. Web GUI - periodical schedule form

    Periodical schedule by timetable (cron expression)

    Timetable is specified by a cron expression.

    Table 16. Cron periodical schedule attributes
    Name Description

    Periodicity

    Timetable

    Cron expression

    Cron is a job scheduler which uses its own format for scheduling. i.e. 0 0/2 4-23 * * ? means "every 2 minutes between 4:00 AM and 11:59 PM".

    Active from/to

    Date and time, specified in the yyyy-mm-dd hh:mm:ss format.

    Start skipped executions as soon as possible

    If checked and execution is skipped for any reason (e.g. server restart), it will be triggered immediately when it is possible. Otherwise it is ignored and it will be triggered at the next scheduled time.

    formSchedulePeriodicCron
    Figure 12. Cron periodical schedule form

    When setting up a cron expression, a hint displays it in a human readable format. Furthermore, when you click on each of the field in the expression, the hint expands, indicating which part of the expression you are editing and listing symbols, their meaning and values that can be used in the expression.

    Server cron expression for Days of Week differs from *nix cron expression. Days in cron expression in Server start from 1 which corresponds to Sunday. *nix cron expression uses 0 or 7 for Sunday.

    Allocations of scheduled task on nodes

    In Cluster environment, you can set the node on which the scheduled task will be launched. If not set, the node will be selected automatically from all available nodes (but always just one).

    If you choose:

    • Any node - one of the available nodes will be selected automatically.

    • One of selected nodes - you can select which node will run the task.

    scheduling allocation 020
    Figure 13. Schedule allocation - One ore more specific nodes

    Scheduling the tasks - examples

    Start a graph at specific time

    This example shows scheduling the start of a graph at specific time.

    1. In the Scheduling section of the Server GUI, click on the New schedule button.

    2. Enter a Schedule name.

    3. In the Periodicity drop-down list, choose Onetime to start the graph just once.

    4. Enter Start time. Use the calendar calendar to enter the required date and time in a correct format.

    5. In the Task type field, choose Start a graph.

    6. Select a Sandbox and a Graph within the sandbox.

    Start a jobflow once an hour

    This example shows scheduling of a periodic task.

    Create a new schedule that runs the UserStats.jbf jobflow from the reports sandbox once an hour.

    1. Enter a Schedule name.

    2. In the Periodicity drop-down list, choose Interval.

    3. Enter the interval between two jobflow starts in the Run every field. In the drop-down list, you can choose between seconds, minutes and hours units.

    4. The task will be started once an hour within a specified time period. Enter the beginning and end of this period in the Active from to fields.

    5. Select the Sandbox and Graph.

    Complex scheduling

    This example shows a complex scheduling using a cron expression.

    Start a graph WeekendGraph.grf every Saturday and Sunday at 22:15.

    1. Enter a Schedule name.

    2. In the Periodicity drop-down list, choose Timetable.

    3. Edit the Cron expression field. The expression for every Saturday and Sunday at 22:15 is 0 15 22 ? * 1,7.

    4. In the Task type field, choose Start a graph.

    5. Select the Sandbox and Graph.

    Alerts and notifications

    The Alerts and Notification tab allows setting the condition when a Schedule is marked as failing. You can also set up email notifications for the failures here and set up monitoring in the Operations Dashboard. See Alerts and notifications for more details.

    scheduling alerts tab
    Figure 14. Schedule - Alerts and Notification