I want to make sure my python script is always running, 24/7. It's on a Linux server. If the script crashes I'll restart it via cron. 
Is there any way to check whether or not it's running?
Create a script (say check_process.sh) which will


Find the process id for your python script by using ps command.
Save it in a variable say pid
Create an infinite loop. Inside it, search for your process. If found then sleep for 30 or 60 seconds and check again.
If pid not found, then exit the loop and send mail to your mail_id saying that process is not running.


Now call  check_process.sh by a nohup so it will run in background continuously. 
I implemented it way back and remember it worked fine.
How to check whether or not a python script is up?