echo 開始上傳
rz
echo 上傳成功茁彭,等待30s
killall -9 java
echo 殺死java進程
echo 進行中
i=0;
str=""
arr=("|" "/" "-" "\\")
while [ $i -le 100 ]
do
let index=i%4
printf "\e[0;1m[%-100s][%d%%]%c\r" "$str" "$i" "${arr[$index]}"
sleep 0.3
let i++
str+='='
done
printf "\n"
echo 完成崎页,重新啟動Java服務
if [ -f "data-service-1.0.0-SNAPSHOT.jar" ]
then
echo 重命名service-jar包
mv /usr/local/data-jar/service/data-service-1.0.0-SNAPSHOT.jar /usr/local/data-jar/service/data-service-1.0.0-SNAPSHOT.jar.`date +%Y%m%d%H%M%S`
echo service重命名完成
echo 移動service-jar包
mv data-service-1.0.0-SNAPSHOT.jar /usr/local/data-jar/service/data-service-1.0.0-SNAPSHOT.jar
fi
if [ -f "data-schedule-1.0.0-SNAPSHOT.jar" ]
then
echo 重命名schedule-jar包
mv /usr/local/data-jar/schedule/data-schedule-1.0.0-SNAPSHOT.jar /usr/local/data-jar/schedule/data-schedule-1.0.0-SNAPSHOT.jar.`date +%Y%m%d%H%M%S`
echo schedule重命名完成
echo 移動schedule-jar包
mv data-schedule-1.0.0-SNAPSHOT.jar /usr/local/data-jar/schedule/data-schedule-1.0.0-SNAPSHOT.jar
fi
if [ -f "data-client-1.0.0-SNAPSHOT.jar" ]
then
echo 重命名client-jar包
mv /usr/local/data-jar/client/data-client-1.0.0-SNAPSHOT.jar /usr/local/data-jar/client/data-client-1.0.0-SNAPSHOT.jar.`date +%Y%m%d%H%M%S`
echo client重命名完成
echo 移動client-jar包
mv data-client-1.0.0-SNAPSHOT.jar /usr/local/data-jar/client/data-client-1.0.0-SNAPSHOT.jar
fi
if [ -f "/usr/local/tomcat/bin/startup.sh" ]
then
echo 啟動tomcat
/usr/local/tomcat/bin/startup.sh
fi
echo 啟動service-jar
nohup java -jar /usr/local/data-jar/service/data-service-1.0.0-SNAPSHOT.jar >> /usr/local/data-jar/service/nohup.log 2>&1 &
echo 啟動schedule-jar
nohup java -jar /usr/local/data-jar/schedule/data-schedule-1.0.0-SNAPSHOT.jar >> /usr/local/data-jar/schedule/nohup.log 2>&1 &
echo 啟動client-jar
nohup java -jar /usr/local/data-jar/client/data-client-1.0.0-SNAPSHOT.jar >> /usr/local/data-jar/client/nohup.log 2>&1 &
killall -9 java
echo 殺死java進程
echo 進行中
i=0;
str=""
arr=("|" "/" "-" "\\")
while [ $i -le 100 ]
do
let index=i%4
printf "\e[0;1m[%-100s][%d%%]%c\r" "$str" "$i" "${arr[$index]}"
sleep 0.3
let i++
str+='='
done
printf "\n"
echo 完成地回,重新啟動程序
/usr/local/tomcat/bin/startup.sh
nohup java -jar /usr/local/data-jar/service/data-service-1.0.0-SNAPSHOT.jar >> /usr/local/data-jar/service/nohup.log 2>&1 &
nohup java -jar /usr/local/data-jar/schedule/data-schedule-1.0.0-SNAPSHOT.jar >> /usr/local/data-jar/schedule/nohup.log 2>&1 &
nohup java -jar /usr/local/data-jar/client/data-client-1.0.0-SNAPSHOT.jar >> /usr/local/data-jar/client/nohup.log 2>&1 &
最后編輯于 :
?著作權歸作者所有,轉載或內容合作請聯(lián)系作者