-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathservice_check.sh
27 lines (23 loc) · 937 Bytes
/
service_check.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
#!/bin/sh
P_ID1=$(ps -ef |grep "dwsurvey-oss-vue" |grep " $1 " |grep -v "grep" |awk '{print $2}')
DATA=$(date +"%Y-%m-%d-%H%M")
echo $DATA
if [ "$P_ID1" == "" ]; then
echo "dwsurvey-oss-vue process not exists"
mv /data/dwsurvey/log/8080.log /data/dwsurvey/log/$DATA-8080.log
nohup java -Dfile.encoding=utf-8 -jar dwsurvey-oss-vue-v.*.*.jar \
--spring.profiles.active=prod --server.port=8080 \
--spring.datasource.username=xxxx \
--spring.datasource.password=xxxx \
>> /data/dwsurvey/log/8080.log &
else
echo "dwsurvey-oss-vue process pid is: $P_ID1"
fi
P_ID2=$(ps -ef |grep "python" |grep "app.py" |grep " $1 " |grep -v "grep" |awk '{print $2}')
if [ "$P_ID2" == "" ]; then
echo "flask process not exists"
mv /data/dwsurvey/log/8082.log /data/dwsurvey/log/$DATA-8082.log
nohup /usr/bin/python3.9 /data/dwsurvey/flaskProject/app.py >> /data/dwsurvey/log/8082.log &
else
echo "flask process pid is: $P_ID2"
fi