crontab -e
10分鐘一次
*/10 * * * * /home/script/checkprocess.sh
/home/script/checkprocess.sh
檢查7001
安裝 lsof
yum install lsof
#!/bin/bash
if /usr/sbin/lsof -Pi :7001 -sTCP:LISTEN -t >/dev/null ; then
echo "running"
else
echo "not running"
fi
iThome鐵人賽