retrieval_start.sh 561 B

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