shell脚本杀进程重启
#!/bin/bash ID=`ps -ef | grep "abc" | grep -v "$0" | grep -v "grep" | awk '{print $2}'` echo $ID echo "---------------" for id in $ID do kill -9 $id echo "killed $id" done echo "---------------" nohup java -jar /home/abc.jar >/home/log.out & nohup cat /home/log.out |cronolog /home/logs/log_%Y%m%d.log 2>&1 &