A script to check free RAM and reboot if it is less than a limit

A script to check free RAM and reboot if it is less than a limit 
 ################
#!/bin/bash
mem=$(free -mo | awk '/Mem/ { print $4 }')
if [ $mem -lt "410" ] ; then
echo "reboot"
fi

######################

Crontab to auto check

Post a Comment