Manual:System/Scheduler

Contents

Summary

The scheduler can trigger script execution at a particular time moment, after a specified time interval, or both.

Properties

interval(time; default: 0s) - interval between two script executions, if time interval is set to zero, the script is only executed at its start time, otherwise it is executed repeatedly at the time interval is specified

namename) - name of the task

on-event(name) - name of the script to execute. It must be presented at /system script

run-count(read-only: integer) - to monitor script usage, this counter is incremented each time the script is executed

start-date(date) - date of the first script execution

start-time(time) - time of the first script execution

startup - execute the script 3 seconds after the system startup.

Notes

Rebooting the router will reset the run-count counter.

If more than one script has to be executed simultaneously, they are executed in the order they appear in the scheduler configuration. This can be important if one scheduled script is used to disable another one.

If a more complex execution pattern is needed, it can usually be done by scheduling several scripts, and making them enable and disable each other.

Note: if scheduler item has start-time set to startup, it behaves as if start-time and start-date were set to time 3 seconds after console starts up. It means that all scripts having start-time is startup and interval is 0 will be executed once each time router boots. If the interval is set to value other than 0 scheduler will not run at startup

In another example, there will be two scripts added that will change the bandwidth setting of a queue rule "Cust0". Every day at 9AM the queue will be set to 64Kb/s and at 5PM the queue will be set to 128Kb/s. The queue rule, the scripts, and the scheduler tasks are below: