#!/bin/bash #check log size while true do log_size=`stat -c%s /home/test_esb_181.log` log_size=$[$log_size / $[1024 * 1024]] #echo log_size if [ "$log_size" -gt "20" ] then mv /home/test_esb_181.log /home/test_esb_181.log.`date +%s` touch /home/test_esb_181.log fi sleep 60 done& #!/bin/bash #test ping esb #ping 172.16.38.181 and ping 172.16.38.134 if [ ! -f /home/test_esb_181.log ] then touch /home/test_esb_181.log fi while true do ping -c 1 172.16.38.181|grep from >>/home/test_esb_181.log sleep 1 done&