Browse Source

Create @reboot .... Cron jobs (#213)

* Update file.sls

add replace

* Update file.sls

update replace

* Update job.sls

Added the opportunity to set a job with a special keyword like '@reboot' or '@hourly'. Quotes must be used, otherwise PyYAML will strip the '@' sign.
https://docs.saltstack.com/en/master/ref/states/all/salt.states.cron.html

* Update README.rst

Added the opportunity to set a job with a special keyword like '@reboot' or '@hourly'. Quotes must be used, otherwise PyYAML will strip the '@' sign.

* Update README.rst
pull/214/head
preussal 4 years ago
parent
commit
fdbabe955e
No account linked to committer's email address
2 changed files with 28 additions and 8 deletions
  1. +16
    -0
      README.rst
  2. +12
    -8
      linux/system/job.sls

+ 16
- 0
README.rst View File

hour: 2 hour: 2
minute: 0 minute: 0


Added the opportunity to set a job with a special keyword like '@reboot' or '@hourly'. Quotes must be used, otherwise PyYAML will strip the '@' sign.

.. code-block:: yaml

linux:
system:
...
job:
cmd1:
command: '/cmd/to/run'
identifier: cmd1
enabled: true
user: 'root'
special: '@reboot'


Managing 'at' tasks Managing 'at' tasks
------------------- -------------------



+ 12
- 8
linux/system/job.sls View File

- identifier: {{ job.get('identifier', job.get('name', name)) }} - identifier: {{ job.get('identifier', job.get('name', name)) }}
{%- endif %} {%- endif %}
- user: {{ job_user }} - user: {{ job_user }}
{%- if job.minute is defined %}
{%- if job.special is defined %}
- special: '{{ job.special }}'
{%- else %}
{%- if job.minute is defined %}
- minute: '{{ job.minute }}' - minute: '{{ job.minute }}'
{%- endif %}
{%- if job.hour is defined %}
{%- endif %}
{%- if job.hour is defined %}
- hour: '{{ job.hour }}' - hour: '{{ job.hour }}'
{%- endif %}
{%- if job.daymonth is defined %}
{%- endif %}
{%- if job.daymonth is defined %}
- daymonth: '{{ job.daymonth }}' - daymonth: '{{ job.daymonth }}'
{%- endif %}
{%- if job.month is defined %}
{%- endif %}
{%- if job.month is defined %}
- month: '{{ job.month }}' - month: '{{ job.month }}'
{%- endif %} {%- endif %}
{%- if job.dayweek is defined %}
{%- if job.dayweek is defined %}
- dayweek: '{{ job.dayweek }}' - dayweek: '{{ job.dayweek }}'
{%- endif %}
{%- endif %} {%- endif %}
- require: - require:
- sls: linux.system.cron - sls: linux.system.cron

Loading…
Cancel
Save