diff options
author | Christian Poessinger <christian@poessinger.com> | 2019-12-20 19:46:03 +0100 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2019-12-20 19:46:03 +0100 |
commit | 695a88c7e40719e4befe2b3a5559822fe3043b8d (patch) | |
tree | 599964940ec8687aa22d56ea00109ef07d6d3ac5 | |
parent | 6580e3f987aa6302b63ed43cfc98da1fb6b4c59c (diff) | |
download | vyos-documentation-695a88c7e40719e4befe2b3a5559822fe3043b8d.tar.gz vyos-documentation-695a88c7e40719e4befe2b3a5559822fe3043b8d.zip |
task-scheduler: rewrite with new cfgcmd syntax
-rw-r--r-- | docs/command-scripting.rst (renamed from docs/commandscripting.rst) | 4 | ||||
-rw-r--r-- | docs/index.rst | 2 | ||||
-rw-r--r-- | docs/system/serial-console.rst | 4 | ||||
-rw-r--r-- | docs/system/task-scheduler.rst | 70 |
4 files changed, 30 insertions, 50 deletions
diff --git a/docs/commandscripting.rst b/docs/command-scripting.rst index 3c437fb0..7d0ab6c5 100644 --- a/docs/commandscripting.rst +++ b/docs/command-scripting.rst @@ -1,6 +1,6 @@ -.. _commandscripting: +.. _command-scripting: -Command scripting +Command Scripting ================= VyOS supports executing configuration and operational commands non-interactively diff --git a/docs/index.rst b/docs/index.rst index 14ba9e71..4d25bb09 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -42,7 +42,7 @@ VyOS User Guide high-availability vpn/index load-balancing - commandscripting + command-scripting troubleshooting diff --git a/docs/system/serial-console.rst b/docs/system/serial-console.rst index 53322f53..cd27fa21 100644 --- a/docs/system/serial-console.rst +++ b/docs/system/serial-console.rst @@ -38,9 +38,9 @@ Major upgrades to the installed distribution may also require console access. * ``57600`` - 57,600 bps * ``115200`` - 115,200 bps (default for serial console) -############## +############### Network Console -############## +############### TBD. diff --git a/docs/system/task-scheduler.rst b/docs/system/task-scheduler.rst index 7fe49988..869a0600 100644 --- a/docs/system/task-scheduler.rst +++ b/docs/system/task-scheduler.rst @@ -1,60 +1,40 @@ .. _task-scheduler: +############## +Task Scheduler +############## -Task scheduler --------------- +The task scheduler allows you to execute tasks on a given schedule. It makes +use of UNIX cron_. -| Task scheduler — allows scheduled task execution. Note that scripts excecuted this way are executed as root user - this may be dangerous. -| Together with :ref:`commandscripting` this can be used for automating configuration. +.. note:: All scripts excecuted this way are executed as root user - this may + be dangerous. Together with :ref:`command-scripting` this can be used for + automating (re-)configuration. -.. code-block:: none +.. cfgcmd:: set system task-scheduler task '<task>' interval '<interval>' - system - task-scheduler - task <name> - cron-spec <UNIX cron time spec> - executable - arguments <arguments string> - path <path to executable> - interval - <int32>[mhd] + Specify the time interval when `<task>` should be executed. The interval + is specified as number with one of the following suffixes: -Interval -******** + * ``none`` - Execution interval in minutes + * ``m`` - Execution interval in minutes + * ``h`` - Execution interval in hours + * ``d`` - Execution interval in days -You are able to set the time as an time interval. + .. note:: If suffix is omitted, minutes are implied. -.. code-block:: none +.. cfgcmd:: set system task-scheduler task '<task>' crontab-spec '<spec>' - set system task-scheduler task <name> interval <value><suffix> + Set execution time in common cron_ time format. A cron `<spec>` of + ``30 */6 * * *`` would execute the `<task>` at minute 30 past every 6th hour. -Sets the task to execute every N minutes, hours, or days. Suffixes: +.. cfgcmd:: set system task-scheduler task '<task>' executable path '<path>' - * m — minutes - * h — hours - * d — days + Specify absolute `<path>` to script which will be run when `<task>` is + executed. -If suffix is omitted, minutes are implied. +.. cfgcmd:: set system task-scheduler task '<task>' executable arguments '<args>' -Or set the execution time in common cron time. + Arguments which will be passed to the executable. -.. code-block:: none - - set system task-scheduler task TEST crontab-spec "* * * 1 *" - -Example -******* - -.. code-block:: none - - system - task-scheduler - task mytask - interval 2h - executable - path /config/scripts/mytask - arguments "arg1 arg2 arg3" - task anothertask - cron-spec "* * * 1 *" - executable - path /config/scripts/anothertask
\ No newline at end of file +.. _cron: https://en.wikipedia.org/wiki/Cron |