日期:2014-05-16  浏览次数:20714 次

linux编写一个脚本判断程序是否在运行,如果没运行就重启这个软件。
RT 先谢过大家了。

------解决方案--------------------
processExist=`ps aux|grep processName|grep -v "grep" `
if [ -z $processExist ];then
exec processName
else
echo "process is running"
fi
------解决方案--------------------
版主所言甚对
------解决方案--------------------
探讨
processExist=`ps aux|grep processName|grep -v "grep" `
if [ -z $processExist ];then
exec processName
else
echo "process is running"
fi