bundles/cron: provide some environment, also manage /etc/crontab
All checks were successful
bundlewrap/pipeline/head This commit looks good
All checks were successful
bundlewrap/pipeline/head This commit looks good
This commit is contained in:
parent
1ffe8bd23e
commit
67386d9efa
4 changed files with 50 additions and 2 deletions
14
bundles/cron/files/cron_template
Normal file
14
bundles/cron/files/cron_template
Normal file
|
@ -0,0 +1,14 @@
|
|||
# __ ____
|
||||
# / /_ __ ______ ____/ / /__ _ ___________ _____
|
||||
# / __ \/ / / / __ \/ __ / / _ \ | /| / / ___/ __ `/ __ \
|
||||
# / /_/ / /_/ / / / / /_/ / / __/ |/ |/ / / / /_/ / /_/ /
|
||||
#/_.___/\__,_/_/ /_/\__,_/_/\___/|__/|__/_/ \__,_/ .___/
|
||||
# /_/
|
||||
#
|
||||
# CAUTION! This file is managed with bundlewrap.
|
||||
# Any manual edits will be lost!
|
||||
|
||||
SHELL=/bin/sh
|
||||
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
|
||||
|
||||
${cron}
|
17
bundles/cron/files/crontab
Normal file
17
bundles/cron/files/crontab
Normal file
|
@ -0,0 +1,17 @@
|
|||
# __ ____
|
||||
# / /_ __ ______ ____/ / /__ _ ___________ _____
|
||||
# / __ \/ / / / __ \/ __ / / _ \ | /| / / ___/ __ `/ __ \
|
||||
# / /_/ / /_/ / / / / /_/ / / __/ |/ |/ / / / /_/ / /_/ /
|
||||
#/_.___/\__,_/_/ /_/\__,_/_/\___/|__/|__/_/ \__,_/ .___/
|
||||
# /_/
|
||||
#
|
||||
# CAUTION! This file is managed with bundlewrap.
|
||||
# Any manual edits will be lost!
|
||||
|
||||
SHELL=/bin/sh
|
||||
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
|
||||
|
||||
${min} * * * * root cd / && run-parts --report /etc/cron.hourly
|
||||
${min} 6 * * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )
|
||||
${min} 6 * * 7 root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly )
|
||||
${min} 6 1 * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly )
|
|
@ -1,4 +1,11 @@
|
|||
files = {}
|
||||
files = {
|
||||
'/etc/crontab': {
|
||||
'content_type': 'mako',
|
||||
'context': {
|
||||
'min': (node.magic_number%60),
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
directories = {
|
||||
'/etc/cron.d': {
|
||||
|
@ -11,5 +18,9 @@ directories = {
|
|||
|
||||
for crontab, content in node.metadata.get('cron', {}).items():
|
||||
files['/etc/cron.d/{}'.format(crontab)] = {
|
||||
'content': content + "\n",
|
||||
'source': 'cron_template',
|
||||
'content_type': 'mako',
|
||||
'context': {
|
||||
'cron': content,
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue