allianceauth/loadMon.sh
orbitroom 40c4eff8c7 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.
2015-01-20 18:55:51 -05:00

11 lines
275 B
Bash

#!/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