检测进程不存在自动重启shell脚本
#!/bin/bash WORKDIR="/usr/local/gse/gseagent" [[ -d $WORKDIR ]] && { if ! ps aux|grep './gseAgent' | grep -v grep;then echo 'starting gseagent...' cd $WORKDIR/ ./start.sh echo echo 'start gseAgent success.' else echo echo 'gseAgent started already.' fi } echo 'start gseagent success.'
http://www.cnblogs.com/yangliheng/p/6277574.html