loadMon.sh

allows automated control of the celery scripts when ran as a cron job in order to keep celery from crashing the server due to a loop.
This commit is contained in:
orbitroom 2015-01-20 18:55:51 -05:00
parent 1ab216383a
commit 40c4eff8c7

10
loadMon.sh Normal file
View File

@ -0,0 +1,10 @@
#!/bin/bash
trigger=5.00
load=`cat /proc/loadavg | awk '{print $1}'`
response=`echo | awk -v T=$trigger -v L=$load 'BEGIN{if ( L > T){ print "greater"}}'`
if [[ $response = "greater" ]]
then
killall screen
sleep 8m
bash /home/allianceserver/allianceauth/start_bg_tasks.sh
fi