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.
Tasks you can schedule are described in Tasks.
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
This schedule is triggered just once.
Name | Description |
---|---|
Periodicity |
Onetime |
Start time |
Date and time, specified in the |
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. |
Periodical schedule by interval
This type of schedule is the simplest periodical type. Trigger times are specified by these 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 |
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. |
Periodical schedule by timetable (cron expression)
Timetable is specified by a cron expression.
Name | Description |
---|---|
Periodicity |
Timetable |
Cron expression |
Cron is a job scheduler which uses its own format for scheduling.
i.e. |
Active from/to |
Date and time, specified in the |
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. |
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 the tasks - examples
Start a graph at specific time
This example shows scheduling the start of a graph at specific time.
-
In the Scheduling section of the Server GUI, click on the New schedule button.
-
Enter a Schedule name.
-
In the Periodicity drop-down list, choose Onetime to start the graph just once.
-
Enter Start time. Use the calendar to enter the required date and time in a correct format.
-
In the Task type field, choose Start a graph.
-
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.
-
Enter a Schedule name.
-
In the Periodicity drop-down list, choose Interval.
-
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.
-
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.
-
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.
-
Enter a Schedule name.
-
In the Periodicity drop-down list, choose Timetable.
-
Edit the Cron expression field. The expression for every Saturday and Sunday at 22:15 is
0 15 22 ? * 1,7
. -
In the Task type field, choose Start a graph.
-
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.