读书人

求Linux监测程序并自动重起脚本,该怎么

发布时间: 2012-02-14 19:19:19 作者: rapoo

求Linux监测程序并自动重起脚本
如标题

[解决办法]
this program is to find the process by the process name
if the process is not active
then start this process

pid=`/bin/ps -e |
/bin/grep $1 |
/bin/sed -e 's/^ *// ' -e 's/ .*// '`


if [ "$pid " = " " ]
then
cd *****
sleep 50
./$1
else
echo "The Process ($1) is running! " > > /dev/null
fi

读书人网 >UNIXLINUX

热点推荐