分享至
crontab -e10分鐘一次
*/10 * * * * /home/script/checkprocess.sh
/home/script/checkprocess.sh檢查7001安裝 lsofyum install lsof
#!/bin/bash if /usr/sbin/lsof -Pi :7001 -sTCP:LISTEN -t >/dev/null ; then echo "running" else echo "not running" fi
IT邦幫忙