Hey there,
I want a bash script (script.sh) to run 24/7 in the background which I'm trying to do with the following
nohup /home/<USER>/script.sh &
I'm struggling with building a second bash script which checks if the first one is currently running. If not, then it should restart it using the same line of code above. I would then schedule this second script to run every hour or so and restart script.sh if it's not running anymore.
I'm a complete noob when it comes to bash scripts.
Can someone lead me into the right direction or has a code example?
Thanks a lot!