Linux – Crontab not running

crondjangolinuxpython

I am using putty to login in webfaction server. I used crontab -e command and wrote this line over there and restarted apache. According to this line it would run every minute but even after restarting its not running. But why? I want to run python script if i run it through putty by using python2.7 alerts_test.py it runs perfectly. But using cron it does'nt. Please help. Thanks in advance. My crontab command is below…

* * * * * /home/gbtech/webapps/django/lib/python2.7 /home/gbtech/webapps/django/fortis_django/alerts_test.py

also tried

* * * * * python2.7 /home/gbtech/webapps/django/fortis_django/alerts_test.py

Best Answer

Couple questions..

  • Did you try placing a MAILTO directive at the top? This would send you all encountered errors.

MAILTO:"mydebugmail@gmail.com"
* * * * * /home/gbtech/webapps/django/lib/python2.7/home/gbtech/webapps/django/fortis_django/alerts_test.py

  • Did you check if alerts_test.py is set to be executable? Perhaps try chmodding it to 755 just in case?

  • Is crond, the cron daemon running?

  • Is there any info in the log, found in /var/log/cron ?