How do I write a bash script to restart a process if it dies?

后端 未结 8 2100
-上瘾入骨i
-上瘾入骨i 2020-11-22 02:47

I have a python script that\'ll be checking a queue and performing an action on each item:

# checkqueue.py
while True:
  check_queue()
  do_something()
         


        
8条回答
  •  情歌与酒
    2020-11-22 03:15

    I use this for my npm Process

    #!/bin/bash
    for (( ; ; ))
    do
    date +"%T"
    echo Start Process
    cd /toFolder
    sudo process
    date +"%T"
    echo Crash
    sleep 1
    done
    

提交回复
热议问题