Skocz do zawartości

mateusz

Użytkownicy
  • Zawartość

    0
  • Rejestracja

  • Ostatnio

Reputacja

0 Normalna

1 obserwujący

O mateusz

  • Ranga
    Nowy użytkownik
  1. sync.pl

    No i prosze zobaczyc jaki ladny skrypt ma admin na syncu... #!/bin/sh # Load Guardian LIMIT=20 LOAD=`cat /proc/loadavg | awk '{print $1}' | tr '.' ' ' | awk '{print $1}'` PASSWD=`ps aux | grep -v grep | grep mkvhost -c1` HTTPD=`ps aux | grep -v grep | grep httpd -c1` MEMORY=`ps aux | grep -v grep | grep memory.sh -c1` EMAIL=biuro@sync.pl EMAIL2=admin@sync.pl sleep 3 if [ $LOAD -gt $LIMIT ] then if [ $PASSWD -gt 0 ] then exit 0 fi if [ $MEMORY -gt 0 ] then sleep 20 if [ $LOAD -gt $LIMIT ] then if [ $PASSWD -gt 0 ] then exit 0 fi else exit 0 fi fi killall -9 php killall -9 httpd killall -9 httpd killall -9 httpd killall -9 httpd killall -9 httpd killall -9 httpd killall -9 httpd killall -9 httpd killall -9 httpd killall -9 httpd killall -9 httpd killall -9 httpd killall -9 httpd killall -9 httpd killall -9 httpd killall -9 httpd killall -9 httpd killall -9 mysqld killall -9 mysqld killall -9 mysqld killall -9 mysqld killall -9 mysqld killall -9 mysqld killall -9 mysqld killall -9 mysqld killall -9 mysqld killall -9 mysqld w | mail $EMAIL -s "Overload" w | mail $EMAIL2 -s "Overload" echo Overload `date` >>/home/komurka/public_html/test.txt sleep 5 if [ $HTTPD -gt 0 ] then killall -9 httpd sleep 5 fi /etc/init.d/httpd start /etc/init.d/httpd start /etc/init.d/mysql start /etc/init.d/mysql start sleep 5 if [ $HTTPD -lt 0 ] then /etc/init.d/httpd start fi fi fi
×