mirror of
https://gitlab.com/allianceauth/allianceauth.git
synced 2025-07-10 13:00:16 +02:00
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.
11 lines
275 B
Bash
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
|