Bash: Keep Script Running - Restart on Crash

1 · Marc Päpper · Aug. 11, 2019, 8:56 a.m.
When you are prototyping and developing small scripts that you keep running, it might be annoying that they quit when an error occurs. If you want very basic robustness against these crashes, you can at least use a bash script to automatically restart your script on error. The tool to use here is called until and makes this a breeze. Let’s use a dumb example Python script called test.py: import time while True: print('Looping') time....