title: crontab to run python file if not running already
body: <p>I want to execute my python file via crontab only if its down or not running already. I tried adding below entry in cron tab but it does not work</p>
  
  <pre><code>24 07 * * * pgrep -f test.py || nohup python /home/dp/script/test.py &amp; &gt; /var/tmp/test.out
  </code></pre>
  
  <p>test.py works fine if i run  <code>pgrep -f test.py || nohup python /home/dp/script/test.py &amp; &gt; /var/tmp/test.out</code> manually and it also works in crontab if i remove pgrep -f test.py || from my crontab and just keep <code>24 07 * * * nohup python /home/dp/script/test.py &amp; &gt; /var/tmp/test.out</code></p>
  
  <p>Any idea why crontab does not work if i add pgrep -f? is there any other way i can run test.py just one time to avoid multiple running processes of test.py?
  Thanks,
  Deepak</p>