|
Server : Apache/2.2.2 (Fedora) System : Linux App1.pathumtani.go.th 2.6.20-1.2320.fc5smp #1 SMP Tue Jun 12 19:40:16 EDT 2007 i686 User : apache ( 48) PHP Version : 5.2.9 Disable Function : NONE Directory : /etc/cron.monthly/ |
Upload File : |
#!/bin/bash
# Generate per system static delay for cron.{daily,weekly,monthly}
# (P) & (C) 2006 by Peter Bieringer <pb@bieringer.de>
#
# 20060322/PB: initial release
# License: GPLv2
factor=1 # max. ~ 68 minutes
#factor=2 # max. ~ 34 minutes
# Create md5sum of hostname (static over system lifetime)
md5sum="`echo ${HOSTNAME} | md5sum`"
# Extract the first 3 hexdigits (12 Bit: 0-4095)
hexvalue="${md5sum:0:3}"
# Create decimal value
decvalue="`printf "%d" "0x${hexvalue}"`"
# Divide delay by factor
DELAY=$[ ${decvalue} / ${factor} ]
sleep $DELAY
exit 0