tt-server/restart.sh

21 lines
602 B
Bash
Raw Normal View History

2023-04-19 11:55:42 +00:00
#! /bin/sh
while true; do
monitor=$(ps -ef | grep "./server.py" | grep -v grep | wc -l)
2024-01-25 02:25:08 +00:00
# cur_dateTime=$(date +%Y-%m-%d_%H-%M-%s)
if [ $monitor -eq 0 ]; then
echo $cur_dateTime" --- ./server.py program is not running, restart now"
2024-01-07 02:48:47 +00:00
# cd ~/tt/tt-tcp
#if= "./log-"$cur_dateTime".txt"
2024-01-07 02:48:47 +00:00
# f="./log-"${cur_dateTime}".txt"
2024-01-25 02:25:08 +00:00
# mv "./rxlog.txt" "rxlog/rxlog-"${cur_dateTime}".txt"
#cd /root/tt/tt-tcp
#mv rxlog.txt "./rxlog-"$cur_dateTime".txt"
2024-01-07 02:48:47 +00:00
# nohup python3 -u ./server.py >>$f 2>&1 &
nohup python3 -u ./server.py &
fi
sleep 5
2023-04-19 11:55:42 +00:00
done