The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Operating Systems > 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 08:57 PM
Cron problem tez UNIX for Dummies Questions & Answers 3 10-27-2006 05:48 PM
cron problem! blowtorch UNIX for Advanced & Expert Users 4 03-08-2006 01:12 AM
cron problem VPN UNIX for Dummies Questions & Answers 2 04-16-2004 06:27 AM
Cron Problem Raiden Shell Programming and Scripting 4 11-16-2003 07:00 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 11-24-2005
jhansrod jhansrod is offline
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
  #2 (permalink)  
Old 11-24-2005
jhansrod jhansrod is offline
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 ?
  #3 (permalink)  
Old 11-25-2005
bakunin bakunin is offline Forum Staff  
Bughunter Extraordinaire
  
 

Join Date: May 2005
Location: In the leftmost byte of /dev/kmem
Posts: 1,628
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
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 03:26 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0