I am using "screen" to run a number of python scripts in AWS (linux build). One of those scripts will sometimes fail, for one reason or another. I would like to write either a) a python script or b) some kind of linux command line script to watch what python scripts are running, and if the target 'script.py' its not running then to rerun it.
For example:
import time
while(True):
if script.py is running:
time.sleep(5)
else:
open new linux screen
python3 script.py
detach screen
I'm sorry for this being vague, I never learned command line stuff, and I use it once in a blue moon. Screen took me a day to figure out how to use..
Thanks so much