Check if the process exists, start it if it does not exist

Save as shell script

count=`ps -ef | grep "frpc" | grep -v grep | wc -l`

echo $count

if [$count -eq 0 ];then
        nohup /cagy/frpc -c frpc.ini >/dev/null 2>&1 & <-----start command
fi

 

chmod u+x xxx.sh

Then configure the timing

crontab -e
1 * * * * /root/fr.sh is
executed once every 1 minute

Guess you like

Origin blog.csdn.net/ccagy/article/details/112240292