Linux+Python: need help, have comments...

Oleg Broytmann phd at phd.pp.ru
Mon Jan 28 04:18:37 EST 2002


On Mon, Jan 28, 2002 at 03:07:40AM +0000, Ron Stephens wrote:
> I switched to Linux two weeks ago. Works fine, I like it. One problem,
> can anyone help?

   Welcome!

> I set up a crontab file using the crontab my_cron_file command. I
> checked it with crontab-l and it is fine. Even set up a cron.allow
> config file. my_cron_file is as such:
> 
> 30 4 * * * python mygale.py get all
> 
> When I run these scripts exactly as typed above, from the Bash shell,

   The most obvious difference between your shell and cron is environment.
For example, PATH variable. If your bash knows correct PATH to python
binary - it can run it. If cron does not know the PATH, it can't.
   Solutions: either use full PATH:
30 4 * * * /usr/local/bin/python -O mygale.py get all
   or setup your cron to know your PATH. Usually you can do
PATH=/usr/local/bin:$PATH
   in the beginning of your crontab. But this depends of the version of
cron you are using. Read "man cron" and "man crontab" carefully.

Oleg.
-- 
     Oleg Broytmann            http://phd.pp.ru/            phd at phd.pp.ru
           Programmers don't die, they just GOSUB without RETURN.




More information about the Python-list mailing list