编写启动脚本

示例一:
[chenjl@ipha-dev71-1 sf_tools]$ cd inner-pressure/ [chenjl@ipha-dev71-1 inner-pressure]$ ll total 1012064 -rwxr--r-- 1 chenjl users 601 Aug 14 15:16 application.properties -rwxr--r-- 1 chenjl users 19806856 Dec 26 2018 inner-pressure.jar drwxr-xr-x 2 chenjl users 4096 Aug 18 00:00 logs -rw------- 1 root root 1008182560 Aug 18 22:35 nohup.out -rwxr-xr-x 1 chenjl users 305 May 10 17:27 start.sh [chenjl@ipha-dev71-1 inner-pressure]$ cat start.sh #!/bin/sh cd /mnt/sf_tools/inner-pressure jarName="inner-pressure.jar" ps -ef|grep $jarName |grep -v grep |awk '{print $2}'|while read pid do echo "stop process....." kill -9 $pid done sleep 1 echo "start process....." nohup java -jar inner-pressure.jar &

 

posted @ 2018-07-26 11:43  爱打盹的猫猫  阅读(343)  评论(0编辑  收藏  举报