Problem running Python script as cron job

William R. Dickson wrd at awenet.com
Fri Apr 7 15:28:25 EDT 2000


Hi all,

I've got a Python script that runs very nicely from the command line, 
but seems to hang up and loaf around forever if I run it as a cron job.  
>From the command line, I do:

     /path/to/statsthing -r

That works well.  The script prints many status messages to STDOUT as it 
runs.  I want to preserve these messages when running the script 
automatically, so I do this in the crontab:

     /path/to/statsthing -r > /usr/local/temp/.log

This is a script I rewrote from an old Perl version as a learning 
exercise to teach myself Python.  The Perl version runs from Cron very 
happily with that command.  The Python version runs to a point, then 
simply stops, and I need to kill the processes.  The log contains some 
data, but I'm pretty sure some of it is never being flushed to disk, so 
I'm not sure exactly where it's halting.

Anybody know of any issues with running python scripts from Cron?

Thanks,

-Bill



More information about the Python-list mailing list