Skip to navigation
How write a script to check the free memory?
07.12.13
#!/bin/sh TMP=`free -m | grep "Mem:"` RESULT=`echo $TMP | cut -d \ -f 4` if [ $RESULT -lt 50 ] then /etc/init.d/mongrel_cluster restart mail -s"restart mongrel_cluster" foo@localhost < /dev/null mail -s"restart mongrel_cluster" foo@yahoo.com < /dev/null fi this script check the free memory and restart the mongrel_cluster if not enough
Reply
Anonymous
How write a script to check the free memory?
#!/bin/sh TMP=`free -m | grep "Mem:"` RESULT=`echo $TMP | cut -d \ -f 4` if [ $RESULT -lt 50 ] then /etc/init.d/mongrel_cluster restart mail -s"restart mongrel_cluster" foo@localhost < /dev/null mail -s"restart mongrel_cluster" foo@yahoo.com < /dev/null fi this script check the free memory and restart the mongrel_cluster if not enough
07.12.13
Reply
Anonymous
Information Epoch 1732373649
Think parallel.
Home
Notebook
Contact us