Jump to content

- - - - -

Cron Jobs

4 replies to this topic

#1 Neil Hunter

Neil Hunter

    ProIV Guru

  • Members
  • PipPipPipPipPip
  • 415 posts
  • Gender:Male
  • Location:Johannesburg, South Africa

Posted 28 July 2006 - 08:20 AM

I'm stumped. Busy trying to setup nightly batch processing at a new site. I've got a test function that writes a sequential file with the date and time. I also setup the filename of the sequential file to be date and time. I've then added a cron job for root to run every minute.

Here comes the tricky bit, i'm logging the start, the execution of pro4 and the end of the script. When the cron runs, the start and end of script are coming through but not the execution. I then tried executing my script as root. Works 100%.

This is on RedHat AS 3.0 running 5.5r411.

Any body got a bright idea ? :)

#2 Rob Donovan

Rob Donovan


  • Admin
  • 1,647 posts
  • Gender:Male
  • Location:Spain

Posted 28 July 2006 - 09:25 AM


Can you post your script?


#3 Chris Pepper

Chris Pepper

    ProIV Guru

  • Members
  • PipPipPipPipPip
  • 369 posts
  • Gender:Male
  • Location:United Kingdom

Posted 28 July 2006 - 10:36 AM

Does your script set up all the required environment variables?

#4 Bob Filipiak

Bob Filipiak


  • Members
  • PipPipPipPip
  • 133 posts
  • Gender:Male

Posted 28 July 2006 - 12:52 PM


A silly thought, have you checked the permissions the script normally runs with????

After all, 'root' has no restrictions on it.

Bob Filipiak

#5 Mike Schoen

Mike Schoen


  • Members
  • PipPipPipPip
  • 198 posts
  • Gender:Male
  • Location:Guelph, Canada

Posted 28 July 2006 - 03:41 PM


Is the pro executable on the path when cron runs?

I've run into a few instances where the root PATH is different when logged in as root, and when running cron entries, so that the pro executable is not found.

I would add these commands to the script, to capture the cron environment:

set > /tmp/cron.txt
which pro >> /tmp/cron.txt 2>&1

The set command will show you all environment variables, and the which command will tell you where the pro executable is, or if it can't be located.

If you are connecting to a SQL database, check for the SQL environment variables as well.


Reply to this topic


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users