]> git.pld-linux.org Git - packages/clamav.git/commitdiff
- sleep random amount to avoid all servers hitting clamav servers at same time auto/ac/clamav-0_93-2
authorElan Ruusamäe <glen@pld-linux.org>
Sun, 8 Jun 2008 11:39:27 +0000 (11:39 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    clamav-cron-updatedb -> 1.7

clamav-cron-updatedb

index b2ffb4c0fafd9fb3ec0e06ec68369cdc6b93142a..995468e8b5ee79bbeafaf181b96b26cc8e85c6a6 100644 (file)
@@ -6,6 +6,12 @@
 DIV="$(echo "$(LC_ALL=C date "+%H % ${UPDATE_HOUR}")" | bc)"
 [ "$DIV" = "0" ] || exit 0
 
+# sleep random amount to avoid all servers hitting clamav servers at same time
+# but at most 1800 seconds (half hour)
+rand=${RANDOM:-$$}
+rand="$(echo "$rand % 1800" | bc)"
+sleep $rand
+
 [ -z "$UPDATE_MAIL_MESSAGES" ] && UPDATE_MAIL_MESSAGES="errors"
 [ "$UPDATE_MAIL_MESSAGES" = "errors" ] && freshclamopt="--quiet"
 
This page took 0.02523 seconds and 4 git commands to generate.