The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

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! blowtorch UNIX for Advanced & Expert Users 4 03-08-2006 01:12 AM
Problem with cron jhansrod AIX 2 11-25-2005 04:30 PM
cron problem VPN UNIX for Dummies Questions & Answers 2 04-16-2004 07: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 06-06-2002
hedrict hedrict is offline
Registered User
  
 

Join Date: Jun 2001
Posts: 35
Cron problem?

here's the scoop..

I have a ksh shell script written, that when I run it manually, it works wonderful, when I let it run via cron, it runs (tells me I have it set up correctly) but yet it doesn't run correctly (it only runs part of the commands with the script). what gives?

I've got the #!/bin/ksh thing in the begining of my script....

thanks in advance!

Todd
  #2 (permalink)  
Old 06-06-2002
LivinFree's Avatar
LivinFree LivinFree is offline Forum Advisor  
Goober Extraordinaire
  
 

Join Date: Jul 2001
Location: Portland, OR, USA
Posts: 1,584
In the script, are you using the full path to all of the command?
  #3 (permalink)  
Old 06-07-2002
hedrict hedrict is offline
Registered User
  
 

Join Date: Jun 2001
Posts: 35
I tried that and still no luck. I think the issue lies in an enviroment variable though the line of code that isn't executing is that of another application. I fully qualified the path and still no luck...
  #4 (permalink)  
Old 06-07-2002
random random is offline
Registered User
  
 

Join Date: Jun 2002
Location: North Texas
Posts: 3
If you suspect a possible environment issue, try turning on xtrace ("#/bin/ksh -x") mode inside of your script and letting cron run it. All the trace will then be mailed to you by the cron scheduler. Examining that may show you what is the issue.

Alternatively you can have the cron dump all "visible" output to a couple of log files.

#cron entry
01 * * * * /scriptpath/script >/logs/good.out 2>/logs/badout

(substitute the appropriate schedule of course)

Lastly, unless your .profile has some interactive (requires responses from you) elements you could always source that at the beginning of your script
#!/bin/ksh
#capture any command line params first
some_var=$1
# etc
. ${HOME}/.profile

(is what I do for most of my scripts at work)

That way the environment is the same under cron and when you run it manually.

Just suggestions

Good luck.
  #5 (permalink)  
Old 06-07-2002
hedrict hedrict is offline
Registered User
  
 

Join Date: Jun 2001
Posts: 35
thanks Random! sourceing my .profile fixed it!!
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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 10:10 AM.


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