/special/raw/
Signed-off-by: Steven Armstrong <steven@icarus.ethz.ch>
This commit is contained in:
parent
1ea0ea0b1b
commit
10d0cf00d6
3 changed files with 9 additions and 8 deletions
|
@ -35,9 +35,10 @@ month::
|
||||||
See crontab(5). Defaults to *
|
See crontab(5). Defaults to *
|
||||||
day_of_week::
|
day_of_week::
|
||||||
See crontab(5). Defaults to *
|
See crontab(5). Defaults to *
|
||||||
special::
|
raw::
|
||||||
See EXTENSIONS in crontab(5). e.g. reboot, yearly, monthly
|
Take whatever the user has given instead of time and date fields.
|
||||||
If given all other time and date fields are ignored.
|
If given, all other time and date fields are ignored.
|
||||||
|
Can for example be used to specify cron EXTENSIONS like reboot, yearly etc.
|
||||||
|
|
||||||
|
|
||||||
EXAMPLES
|
EXAMPLES
|
||||||
|
@ -50,7 +51,7 @@ __cron some-id --user root --command "/path/to/script" \
|
||||||
|
|
||||||
# run on reboot
|
# run on reboot
|
||||||
__cron some-id --user root --command "/path/to/script" \
|
__cron some-id --user root --command "/path/to/script" \
|
||||||
--special reboot
|
--raw @reboot
|
||||||
|
|
||||||
# remove cronjob
|
# remove cronjob
|
||||||
__cron some-id --user root --command "/path/to/script" --state absent
|
__cron some-id --user root --command "/path/to/script" --state absent
|
||||||
|
|
|
@ -25,9 +25,9 @@ command="$(cat "$__object/parameter/command")"
|
||||||
# set defaults
|
# set defaults
|
||||||
test -f "$__object/parameter/state" || echo "present" > "$__object/parameter/state"
|
test -f "$__object/parameter/state" || echo "present" > "$__object/parameter/state"
|
||||||
|
|
||||||
if [ -f "$__object/parameter/special" ]; then
|
if [ -f "$__object/parameter/raw" ]; then
|
||||||
special="$(cat "$__object/parameter/special")"
|
raw="$(cat "$__object/parameter/raw")"
|
||||||
entry="@$special $command"
|
entry="$raw $command"
|
||||||
else
|
else
|
||||||
minute="$(cat "$__object/parameter/minute" 2>/dev/null || echo "*")"
|
minute="$(cat "$__object/parameter/minute" 2>/dev/null || echo "*")"
|
||||||
hour="$(cat "$__object/parameter/hour" 2>/dev/null || echo "*")"
|
hour="$(cat "$__object/parameter/hour" 2>/dev/null || echo "*")"
|
||||||
|
|
|
@ -4,4 +4,4 @@ hour
|
||||||
day_of_month
|
day_of_month
|
||||||
month
|
month
|
||||||
day_of_week
|
day_of_week
|
||||||
special
|
raw
|
||||||
|
|
Loading…
Reference in a new issue