Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a long cron job running a python script in CENTOS, but for some reason it seems to timeout or otherwise end without completion.

the job runs fine when executed straight from bash, but seems to stall in pretty much the same place every time when triggered by cron.

it seems like there's a timeout but apparently cron doesn't have one?

am at a loss of where to look to debug this... any pointers on where to look / how to debug are much appreciated!

share|improve this question
Capture Python script stdout and stderr output to a file would be first step how to debug this – Mikko Ohtamaa Feb 4 '12 at 15:11
Hi Mikko, I tried this & there were no errors in the stderr - however with karma i've found the culprit - thanks! – significance Feb 7 '12 at 9:36

first log stdout and stderr

18 20 * * * python2.6 > /test.log 2>/test.err &

also check /var/log/messages for any information.

in my case i was running out of memory!

Feb  7 03:05:12 computer kernel: Out of memory: Kill process 4915 (python2.6) score 255 or sacrifice child
share|improve this answer
Just an offtopic comment, Instead of using cron for Python tasks, you could try Celery. – Bibhas Feb 7 '12 at 9:47

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .