1234567891011121314151617181920 |
- # !/bin/bash
- # 启动方式: bash -i asr_restart.sh/source asr_restart.sh
- cd /home/ubuntu/tujintao/physics_repeat_check
- conda activate test_env
- server_start(){
- # '{print $1}'中的$1表示取awk输入的第0个字符
- pid=`ps ax|grep $1|grep -v grep|awk '{print $1}'`
- if [ -z ${pid} ]; then
- echo "即将启动$1服务"
- nohup python $1 >> logs/$2 2>&1 &
- fi
- }
- server_list=(retrieval_app.py retrieval_monitor_app.py)
- log_list=(retrieval_app.log temp_app.log)
- for i in 0 1
- do
- server_start ${server_list[$i]} ${log_list[$i]}
- done
|