1825689 Members
3554 Online
109686 Solutions
New Discussion

Re: Log message of cron.

 
Rajesh SB
Esteemed Contributor

Log message of cron.

Hi,

In cron log, noticed 3rd line in below.

CMD: /opt/dispatcher.sh > /dev/null 2>&1
oper 19551 c Wed Sep 17 15:25:00 EDST 2003
oper 19551 c Wed Sep 17 15:25:00 EDST 2003 rc=1
oper 19550 c Wed Sep 17 15:25:03 EDST 2003

I am thinking rc=1 must be a retrun code 1 from script. Am I right?

Any pointer on this?

Thanks in advance.

Cheers,
Rajesh
6 REPLIES 6
Umapathy S
Honored Contributor

Re: Log message of cron.

Rajesh,
rc=1 is the return code from the shell/script. /opt/dispatcher.sh returns 1 to the cron job which is shown in cron log.

HTH,
Umapathy
Arise Awake and Stop NOT till the goal is Reached!
T G Manikandan
Honored Contributor

Re: Log message of cron.

you are right rc is the return code of the script.

most probably due to the environmental variables not defined.

make sure that you define all the env variables inside the cron script.


Thanks
Pete Randall
Outstanding Contributor

Re: Log message of cron.

Rajesh,

I agree that this is a return code. The only suggestion I have is to stop redirecting stderr and stdout to see if you can find out what caused the rc.


Pete


Pete
Pete Randall
Outstanding Contributor

Re: Log message of cron.

Rajesh,

Is user "oper" allowed to use cron? Do they appear in /var/adm/cron/cron.allow?


Pete


Pete
Steven E. Protter
Exalted Contributor

Re: Log message of cron.

The usual problem with cron scripts is the script calls a program that isn't on its PATH or some other environment variable isn't set the way its expected.

Two ways to deal with it. Set the PATH in the script along with other environment variables, or use the full path of all the commands in the script.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Rajesh SB
Esteemed Contributor

Re: Log message of cron.

Hi experts,

Thanks for your prompt response on this issue.
I am succeeded to analyze this error. I am right. Scheduled dispatcher.sh shell script is exiting with return code i.e. rc=1.

Really, I apreciate your various ideas to analyse error.

Cheers,
Rajesh SB