ps -eo pid,ppid,cmd,%mem,%cpu --sort=-%mem|head
ps -aux | sort -k4nr | head -n 10
for ((i=1;i<254;i++));
do
ping -c 1 192.168.5.$i &> /dev/null
if [ $? -eq 0 ];then
echo "ping 192.168.5.$i suecess !"
else
echo "ping 192.168.5.$i fail !"
fi
done
i=1
while [ $i -le 254 ];
do
ping -c 1 192.168.5.$i &> /dev/null
if [ $? -eq 0 ];then
echo "ping 192.168.5.$i success!"
else
echo "ping 192.168.5.$i fail!"
fi
let i=${i}+1
done
vim etcBac.sh
tar -Jcvf /backup/etcBak-
date -d "-1 day" +%Y-%m-%d-%H.tar.xz /etc/
crontab -e
30 1 * * 1-5 /data/etcBac.sh &> /dev/null
vim diskCheck.sh
DISKWARN=`df |grep "/dev/sda*"| tr -s ‘ ‘ % |cut -d % -f 5 |sort -nr | head -1`
if [ $DISKWARN -ge 80 ];then
echo "Warning:the disk space used more than 80%,you need handle it !"
else
exit
fi
crontab -e
*/10 * * * 1-5 /data/diskCheck.sh
原文:https://www.cnblogs.com/shanghongbin/p/13128505.html