sleep $[ ( $RANDOM % 30 ) + 1 ]s
This will introduce a 1-10 second random sleep/pause in the script. Can be handy at times.
I put a cron job to call this script every 3 minutes:
echo '*/3 * * * * root /usr/local/bin/heartbeat.sh >>/var/log/heartbeat.log 2>/var/log/heartbeat.err' >/etc/cron.d/heartbeat
#!/bin/bash
#### To Update AAW node session
#### by Lambert
#### Version 1.0
#### Release Date: 2016-03-29
sleep $((RANDOM % 30))
wget -O /var/log/heartbeat.wget.log $SUBMIT_URL
That is a random sleep from 1 to 30 seconds!
ReplyDeleteyes it does.
ReplyDelete