Commit 68d6097e authored by Jean-Baptiste Petre's avatar Jean-Baptiste Petre Committed by Cédric de Saint Martin

add random crontab etc/cron.d/slapos slapupdate

parent 5c4f0fe6
......@@ -26,6 +26,9 @@
#
##############################################################################
# for crontab /cron.d/slapos slapupdate
import random
systemctl stop slapos-node.service
systemctl disable slapos-node.service
......@@ -119,6 +122,9 @@ if [ $SLAPOS_GOOD_CONFIGURATION != $SLAPOS_CONFIGURATION ]; then
fi
# Set up cron
# random crontab slapupdate
let HOUR=$RANDOM%23;
let MINUTE=$RANDOM%60;
# Remove default route for ipv6 in case of openvpn-needed
echo """# BEWARE: This file will be automatically regenerated on each boot
......@@ -126,7 +132,7 @@ SHELL=/bin/sh
PATH=/usr/bin:/usr/sbin:/sbin:/bin:/usr/lib/news/bin
MAILTO=root
0 0 * * * root /usr/local/bin/slapupdate -v --slapos-configuration $SLAPOS_CONFIGURATION/slapos.cfg >> /opt/slapos/slapupdate.log 2>&1
$MINUTE $HOUR * * * root /usr/local/bin/slapupdate -v --slapos-configuration $SLAPOS_CONFIGURATION/slapos.cfg >> /opt/slapos/slapupdate.log 2>&1
"""> /etc/cron.d/slapos
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment