The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > OS Specific Forums > AIX
Google UNIX.COM


AIX AIX is IBM's industry-leading UNIX operating system that meets the demands of applications that businesses rely upon in today's marketplace.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
problem with cron job solne SUN Solaris 7 01-18-2008 05:57 PM
Cron problem tez UNIX for Dummies Questions & Answers 3 10-27-2006 02:48 PM
cron problem! blowtorch UNIX for Advanced & Expert Users 4 03-07-2006 10:12 PM
cron problem VPN UNIX for Dummies Questions & Answers 2 04-16-2004 03:27 AM
Cron Problem Raiden Shell Programming and Scripting 4 11-16-2003 04:00 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 11-24-2005
Registered User
 

Join Date: May 2005
Posts: 80
Problem with cron

Hi all

I am trying to run a job via cron, however it does not execute. The cron log file has the following lines in it. When I run the command at CL, it works.

root : CMD ( su - JHOps -c $JHOPSROOT/exe/JHOPS15MIN.sh # Execute 15 minute collections ) : PID ( 516342 ) : Fri Nov 25
02:00:00 2005
Cron Job with pid: 155868 Successful
Cron Job with pid: 516342 Failed


Any ideas where I can look to see why it has failed ?

Thanks

J
Reply With Quote
Forum Sponsor
  #2  
Old 11-24-2005
Registered User
 

Join Date: May 2005
Posts: 80
I think the problem is due to the cariable $JHOPSROOT. Does anyone know how I can use a variable in cron ?
Reply With Quote
  #3  
Old 11-25-2005
Bughunter Extraordinaire
 

Join Date: May 2005
Location: In the leftmost byte of /dev/kmem
Posts: 1,256
Yes: the same way you use it in other scripts, but cronjobs inherit nothing from their parent process (unlike jobs started from an interactive shell).

For this reason i do NOT rely in my scripts on a set environment at all but set it to a "standard-environment" with a function i source in first:

Code:
#!/bin/ksh

. /usr/local/lib/ksh/f_env

... rest of the code ...
In short: replace the your job with a script in which a proper environment (including your missing variable) can be set and used easily. Call this script from cron.

bakunin
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 02:08 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0