Question about invoking a python script from cron ... 
Author Message
 Question about invoking a python script from cron ...

Hi, I've been trying to get a python script to run from cron. This script
runs without errors if I invoke it interactively but when the scheduled time
comes up it does not appear to run. I get no errors in the cron.log. This is
the shell script called CXAudit I use (can be found in the  /etc/cron.weekly
directory).

#! /bin/sh
/usr/bin/python /etc/cron.weekly/CXAudit.py

That's it, not very difficult tough stuff. Basically this python script
parses a file owned by user squid (yes, from the squid proxy). Any ideas why
this won't work?



Mon, 17 Mar 2003 03:00:00 GMT  
 Question about invoking a python script from cron ...

Quote:

> Hi, I've been trying to get a python script to run from cron. This script
> runs without errors if I invoke it interactively but when the scheduled time
> comes up it does not appear to run. I get no errors in the cron.log. This is
> the shell script called CXAudit I use (can be found in the  /etc/cron.weekly
> directory).

> #! /bin/sh
> /usr/bin/python /etc/cron.weekly/CXAudit.py

> That's it, not very difficult tough stuff. Basically this python script
> parses a file owned by user squid (yes, from the squid proxy). Any ideas why
> this won't work?

What kind of errors is cron giving you (you should be getting email about
it)?

Just a random thought... I've tried running scripts before in cron and it
gave me errors about not being able to find certain things.  What I was
trying to do was not a huge deal, so I didn't worry about it, but you might
try adding a couple of lines before your script like:

. /etc/profile # or wherever your system dotfiles are.
. /home/me/.profile # substitue "me" with your user name.

I'd be interested to know if that works.

HTH

----------------------------------------------------------------------

Electrical Engineering         http://students.washington.edu/sjuranic
University of Washington             http://rcs.ee.washington.edu/ssli



Mon, 17 Mar 2003 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Problem running Python script as cron job

2. Problem Cron-Job using Python-Script

3. Invoking wish from cron

4. Invoking a script Python from another application

5. Perl CGI Script Invoking Expect Script

6. script/cron problems

7. Still problems running script from cron

8. trouble running an expect script in cron versus command line

9. trouble running an Expect script from cron

10. Running expect scripts from cron..?

11. expect script doesn't work with cron - please help

12. expect: problems running script from CRON

 

 
Powered by phpBB® Forum Software