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

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:

#! /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