Python script run via cron does not execute occassionally

Posted by gcorne on Stack Overflow See other posts from Stack Overflow or by gcorne
Published on 2010-05-06T02:45:50Z Indexed on 2010/05/06 2:48 UTC
Read the original article Hit count: 203

Filed under:
|

I have a simple python script for fetching tweets and caching them to disk that is configured to run every two minutes via cron.

*/2 * * * * (date ; /usr/bin/python /path/get_tweets.py) >> /path/log/get_tweets.log 2>&1

The script runs successfully most of the time. However, every so often the script doesn't execute. In addition to other logging, I added a simple print statement above the meat of the script and nothing except the output from the initial date command makes it to the log.

#!/usr/bin/python
# Script for fetching tweets and then storing them as an HTML snippet for inclusion using SSI

print "Starting get_tweets.py"

Any ideas? The system is a VPS running Centos 5.3 with python 2.4.

© Stack Overflow or respective owner

Related posts about python

Related posts about cron