Below is my script and this script is design to work to check if "python3.6" process is running.
If it is not running then execute python code else exit 0.
I don't see any activity or process running of python from this bash script.
please help me to understand if i scripted something wrong.
Any help is greatly appreciated.
Thanking in advance.
#!/bin/bash
ps x |grep -v grep |grep -c "python3.6"
if [ $? -eq 0 ]; then
bash -c "/home/ubuntu/anaconda3/bin/python3.6 /var/lib/pythoncode/main_progm.py >> /home/ubuntu/Logs.txt"
fi
# End of Script