释放双眼,带上耳机,听听看~!
springboot项目启动可通过下面的shell脚本启动。
startup.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30 11 app=order-service-rest.jar
2 2 appout=logs/${app/.jar/.out}
3 3 appoutHisDir=logs/`date "+%Y%m%d"`
4 4 if test ! -d 'logs' ; then
5 5 mkdir logs
6 6 fi
7 7 if test ! -f $appout ; then
8 8 touch $appout
9 9 fi
1010 if test ! -d $appoutHisDir ;then
1111 echo 'mdkir ' $appoutHisDir
1212 mkdir -p $appoutHisDir &&
1313 gzfiles=$(find logs -maxdepth 1 -name *.gz)
1414 if test ${#gzfiles} -ne 0 ;then
1515 mv logs/*.gz $appoutHisDir/
1616 fi
1717 cp logs/*.out $appoutHisDir/ &&
1818 for hisout in $(ls logs/*.out)
1919 do
2020 echo '' > $hisout
2121 done
2222 fi
2323 appPid=`jps -l|grep $app|awk '{print $1}'`
2424 if test ${#appPid} -ne 0 ;then
2525 echo 'stop server ' $appPid '...'
2626 kill -9 $appPid
2727 fi
2828 nohup java -jar $app >> $appout &
2929 tail -0f $appout
30
启动命令
1
2 1./startup.sh order-service-rest.jar
2