1755643 Members
3169 Online
108837 Solutions
New Discussion

what does it mean?

 
file system
Frequent Advisor

what does it mean?

CMD: /a > /dev/null 2>&1
> root 21954 c 월 4월 10 17:25:00 2006
< root 21954 c 월 4월 10 17:35:40 2006 rc=2
=============================================
it is generated cron log.
what does it mean rc=2?
does it say cmd a cannot execute or any other meaning?


shell cmd of a is
save -s online -b oracle -l full /arch_ispbs/
last_file=`find /arch_ispbs |ls -1|tail -1`
find /arch_ispbs ! -name $last_file |xargs rm

once save execute, find out latest generated file and remove all file except it.

it runs save first..~

but cannot remove all file except latest generated file.
what's the problem?
4 REPLIES 4
Steven E. Protter
Exalted Contributor

Re: what does it mean?

Shalom,

I believe:

rc=2 means return code=2

This is a non-zero return code, meaning the job failed.

Any batch process you run gives(normally) a return code:

bdf
echo $?
That number is the return code and it should be zero.

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
Robert-Jan Goossens
Honored Contributor

Re: what does it mean?

Hi,

legato save command?

try to add the path for the save command inside your script or set a PATH variable before you run your commands.

/opt/networker/bin/save -s .....

or

PATH=/usr/bin:/usr/sbin/:/opt/networker/bin

Best regards,
Robert-Jan
Matti_Kurkela
Honored Contributor

Re: what does it mean?

In addition, because your command line is "/a >/dev/null 2>&1", you are destroying the error messages that might tell you what the problem is.

On the other hand, getting those messages in email might be troublesome, especially if the job always produces some output.

You could leave out the "2>&1" part, so that the normal "notification" messages still go to /dev/null, but the error messages come to cron, which emails them to root account.

Or you could do like I often do:
set up the cron command line like "/a >/tmp/last_oracle_archive.log 2>&1". This avoids all the emails, but the complete message output of the latest run is available if you ever need to solve problems with the cron job.

Because there is only ">", not ">>", the next run's log will overwrite the previous log, so the file does not keep growing indefinitely.
MK
file system
Frequent Advisor

Re: what does it mean?

1.RC=2 Return code =2 should be 0, thank you
2.PATH is not the problem, it had correct name of PATH.
3.I'm going to edit cron log like /tmp/last_log . I think it could be helpful to trace job failed.

Thank you all of you