speed up cron job to be scheduled on a hourly basis instead of daily
authorThierry Parmentelat <thierry.parmentelat@inria.fr>
Mon, 18 Jan 2016 09:18:46 +0000 (10:18 +0100)
committerThierry Parmentelat <thierry.parmentelat@inria.fr>
Mon, 18 Jan 2016 09:18:46 +0000 (10:18 +0100)
cron.d/lxc-sliceimage
cron.d/vserver-sliceimage
lxc-sliceimage.spec
vserver-sliceimage.spec

index 1af9e62..5b4d21d 100644 (file)
@@ -6,4 +6,4 @@
 # Copyright (C) 2006 The Trustees of Princeton University
 #
 
-@M@ @H@ * * *  root    /usr/bin/lxc-sliceimage start >/dev/null 2>&1
+@M@ * * * *    root    /usr/bin/lxc-sliceimage start >/dev/null 2>&1
index 7c3ab35..f85b943 100644 (file)
@@ -6,4 +6,4 @@
 # Copyright (C) 2006 The Trustees of Princeton University
 #
 
-@M@ @H@ * * *  root    /etc/init.d/vserver-sliceimage start >/dev/null 2>&1
+@M@ * * * *    root    /etc/init.d/vserver-sliceimage start >/dev/null 2>&1
index 1bd6ff0..973fff2 100644 (file)
@@ -59,8 +59,8 @@ if [ "$PL_BOOTCD" != "1" ] ; then
    systemctl restart lxc-sliceimage.service
 fi
 
-# Randomize daily run time
+# Randomize hourly run time (used to be daily)
+#H=$((24 * $RANDOM / 32768))
+#sed -i -e "s/@M@/$M/" -e "s/@H@/$H/" %{_sysconfdir}/cron.d/lxc-sliceimage
 M=$((60 * $RANDOM / 32768))
-H=$((24 * $RANDOM / 32768))
-sed -i -e "s/@M@/$M/" -e "s/@H@/$H/" %{_sysconfdir}/cron.d/lxc-sliceimage
-
+sed -i -e "s/@M@/$M/" %{_sysconfdir}/cron.d/lxc-sliceimage
index 7ad003b..5df225b 100644 (file)
@@ -48,7 +48,9 @@ rm -rf $RPM_BUILD_ROOT
 %post
 chkconfig --add vserver-sliceimage
 chkconfig vserver-sliceimage on
-# Randomize daily run time
+
+# Randomize hourly run time (used to be daily)
+#H=$((24 * $RANDOM / 32768))
+#sed -i -e "s/@M@/$M/" -e "s/@H@/$H/" %{_sysconfdir}/cron.d/lxc-sliceimage
 M=$((60 * $RANDOM / 32768))
-H=$((24 * $RANDOM / 32768))
-sed -i -e "s/@M@/$M/" -e "s/@H@/$H/" %{_sysconfdir}/cron.d/vserver-sliceimage
+sed -i -e "s/@M@/$M/" %{_sysconfdir}/cron.d/lxc-sliceimage