script won't run using cron.d or crontab

Robert Bossy Robert.Bossy at jouy.inra.fr
Fri Mar 21 04:01:10 EDT 2008


Bjorn Meyer wrote:
> I appologize if this been discussed previously. If so, just point me 
> to that information.
>
> I have done a fair bit of digging, but I haven't found a description 
> of what to actually do.
>
> I have a fairly lengthy script that I am able to run without any 
> problems from a shell. My problem is, now I am wanting to get it 
> running using crontab or cron.d. It seems that running it this way 
> there is a problem with some of the commands that I am using. For 
> instance "commands.getoutput" or "os.access". I am assuming that there 
> is something missing within the environment that cron runs that fails 
> to allow these commands to run.
> If anyone has any information that would help, it would be greatly 
> appreciated.
Hi,

 From a shell, type:
    man 5 crontab
and read carefully. You'll realize that a croned script does not inherit 
from the user shell's environment.

Cheers,
RB




More information about the Python-list mailing list