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! blowtorch UNIX for Advanced & Expert Users 4 03-07-2006 10:12 PM
Problem with cron jhansrod AIX 2 11-25-2005 01:30 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 01-15-2008
Registered User
 

Join Date: Jun 2007
Posts: 20
Wink CRON problem

Hi all,

I am facing a problem in cron.following are i found and i cant able to find where the problem is exactly......

1> in cron log(/var/adm/cron/log) i found that the cron start my process and it gives PID also but after that it didnt gave any thing like process is failed or sucessfull.
2> I checked current process. and concern process is not running currently.
3>i ran the same script(which i have entered in cron) and i found that it is working fine without any error.

so how can i confirm that the particular script is run sucessfully or failed?????


Thanks in Advance
Reply With Quote
Forum Sponsor
  #2  
Old 01-15-2008
Bughunter Extraordinaire
 

Join Date: May 2005
Location: In the leftmost byte of /dev/kmem
Posts: 1,262
1) do what you expect from cron: write logs. The cron log logs the cron activity, not the activity of the processes started by it. Put some logging messages into your script and write your own log to find out where it goes wrong, like this:

Code:
#! /bin/ksh

# set your environment....
print - "starting script with PID $$" > $logfile

... some commands.....

print - "now here" >> $logfile

... some more commands ....

print - "and now here" >> $logfile

... even more commands ...

print - "finished the script" >> $logfile
exit 0
Then analyze the content of $logfile and find out where it went off track, hence reducing the scope of your analysis. rearrange the log messages to monitor more closely the part where it went wrong, etc., etc....

2) Take the measure Nr 1 for all problems of the i-have-written-a-script-and-it-works-but-i-put-it-in-cron-and-it-failed-type: set that damn environment because cron won't do it for you!

Hope this helps.

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 07:16 PM.


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