restart.sh & mv.sh
作者:互联网
restart.sh
#!/bin/bash cd /opt/eba/tecebaex/home/appdir date +%Y%m%d' '%H:%M:%S | tee -a release.log count=$(ls -l swr*.jar|wc -l) echo '1. count: '$count | tee -a release.log if [ $count -ne 1 ];then echo 'count swr*.jar != 1, fail' | tee -a release.log return fi #echo $1 jar=$(ls swr*.jar) echo '2. deploying: '$jar | tee -a release.log tmp=$(netstat -tpln|grep 8082) echo '4. ' ${tmp} | tee -a release.log tmp2=${tmp#*LISTEN} echo '5. ' ${tmp2} | tee -a release.log tmp3=${tmp2%/java*} tmp3=${tmp3:=0} echo '6. ' ${tmp3} | tee -a release.log echo '#kill -9 '${tmp3} | tee -a release.log if [ $tmp3 -gt 1 ] ;then kill -9 ${tmp3} fi tmp3=${jar#*swr-lix-agent-corso-} tmp4=${tmp3%.jar*} date3=$(date "+%Y%m%d%H%M%S") mv nohup.out logs/nohup.out.$date3.$tmp4 nohup java -jar $jar -spring.config.location=application-uat.properties --spring.profiles.active=uat >> nohup.out 2>&1 &
mv.sh
#!/bin/bash cd /opt/eba/tecebaex/home/appdir date +%Y%m%d' '%H:%M:%S | tee -a release7.log count=$(ls -l swr*.jar|wc -l) echo '1. count: '$count | tee -a release7.log if [ $count -ne 1 ];then echo "1.1. count swr*.jar != 1, fail" | tee -a release7.log exit 3 fi jar=$(ls swr*.jar) echo '2. moving to history: '$jar | tee -a release7.log mv $jar history
标签:count,log,jar,tee,sh,mv,tmp3,echo,restart 来源: https://www.cnblogs.com/xiluhua/p/15878355.html