From 89fcad254031d81bf7e2428819dc4fda6d9a3a8c Mon Sep 17 00:00:00 2001 From: Thierry Parmentelat Date: Mon, 18 Jan 2016 10:18:46 +0100 Subject: [PATCH] speed up cron job to be scheduled on a hourly basis instead of daily --- cron.d/lxc-sliceimage | 2 +- cron.d/vserver-sliceimage | 2 +- lxc-sliceimage.spec | 8 ++++---- vserver-sliceimage.spec | 8 +++++--- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/cron.d/lxc-sliceimage b/cron.d/lxc-sliceimage index 1af9e62..5b4d21d 100644 --- a/cron.d/lxc-sliceimage +++ b/cron.d/lxc-sliceimage @@ -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 diff --git a/cron.d/vserver-sliceimage b/cron.d/vserver-sliceimage index 7c3ab35..f85b943 100644 --- a/cron.d/vserver-sliceimage +++ b/cron.d/vserver-sliceimage @@ -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 diff --git a/lxc-sliceimage.spec b/lxc-sliceimage.spec index 1bd6ff0..973fff2 100644 --- a/lxc-sliceimage.spec +++ b/lxc-sliceimage.spec @@ -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 diff --git a/vserver-sliceimage.spec b/vserver-sliceimage.spec index 7ad003b..5df225b 100644 --- a/vserver-sliceimage.spec +++ b/vserver-sliceimage.spec @@ -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 -- 2.43.0