Strange python script behaviour

Lars Behrens spam.buster at web.de
Tue Aug 4 04:08:23 EDT 2009


Łukasz wrote:

> The strangest thing is that if I change command in CRON
> 
> from
> python /home/xxx/script.py
> to
> python /home/xxx/script.py  > /tmp/script.log 2>&1
> 
> the script always works correctly!!!
> 
> The question is WHY? Any ideas?

Seems to me that this is more of a shell thing...

First of all, it is always a good idea to call applications with their full
path from cronjobs:

/usr/bin/python /home/xxx/script.py or whatever the output of your "which
python" may be.

How did you create the cronjob? Dependending on the editor you used, maybe
there is a missing newline...

-- 
Cheerz Lars



More information about the Python-list mailing list