Operating System - HP-UX
1752782 Members
6162 Online
108789 Solutions
New Discussion юеВ

Re: what does mean crontab Error rc=255 and rc=127

 
Hamdi GULSOY_1
Occasional Contributor

what does mean crontab Error rc=255 and rc=127

Hi,
We have use IDS 7.31 and baan 4c on HPUX b.11
We have a scripts
boytas:/home/hamdi/scripts#more bshrate.sh
. /home/hamdi/.profile
date>>/home/hamdi/statistic/bshrate.st
dbaccess sysmaster bshrate.sql>>/home/hamdi/statistic/bshrate.st

this scripts run right command line, but can not run in crontab .
when I see log file there rc=255 and for other scritp rc=127 returned .
what does it meen code
thanks.

Hamdi
34
7 REPLIES 7
Paula J Frazer-Campbell
Honored Contributor

Re: what does mean crontab Error rc=255 and rc=127

Hi

If a script runs from the command line and not from cron then you are not setting the environmental variables for the cron.

Give all cronned commands the full path - even the system commands.

Paula
If you can spell SysAdmin then you is one - anon
Steve Steel
Honored Contributor

Re: what does mean crontab Error rc=255 and rc=127

Hi

rc=255 is a program that does not
call exit with a specified value.

Other codes

rc=101 no at command file
rc=102 (stat(at_cmdfile,&buf)) was true, so stat(2) returned an error
rc=103 if set uid bit off,
original owner has given file
to someone else
rc=104 bad job open
rc=105 no audit id
rc=106 couldn't set group /user ids, exiting
rc=107 couldn't open stdin
rc=108 no stdin found
rc=109 couldn't open tmp as sh stdin
rc=110 couldn't open output file or /dev/null
rc=111 testing
rc=112 can't exec sh
rc=113 file lock problem
rc=127 can't fork
(this might also be return code from the shell)


Steve Steel
If you want truly to understand something, try to change it. (Kurt Lewin)
Cheryl Griffin
Honored Contributor

Re: what does mean crontab Error rc=255 and rc=127

Try placing "set -x" at the top of your script. This will send output to your screen as the script runs in cron. It may help you troubleshoot the script.

You're probably relying on this line ". /home/hamdi/.profile" to set your environment variables which is the problem. How about adding a "su - hamdi" to the script instead.

Cheryl
"Downtime is a Crime."
harry d brown jr
Honored Contributor

Re: what does mean crontab Error rc=255 and rc=127


You could fix this:

This member has assigned points to 0 of 24 responses to his/her questions.

click here to find your previous posts:

http://forums.itrc.hp.com/cm/TopSolutions/1,,BR657528!1!questions,00.html

live free or die
harry
Live Free or Die

Re: what does mean crontab Error rc=255 and rc=127

Hi Hamdi,

you should be very carrefull when executing
. /home/hamdi/.profile
because in .profile you maybe have some
terminal specifing commands like stty
it obviously works from shell, but not
from cron.
I think you should use in your script instead
of . /home/hamdi/.profile
export INFORMIXDIR=/ifx
.
.
export all other variables
and instead of bshrate.sql use absolute
path to this script ( you dont need to
use sql extension )

I hope it helps.
Best regards,
Hrvoje
Hamdi GULSOY_1
Occasional Contributor

Re: what does mean crontab Error rc=255 and rc=127

Thank all
rc=255 problem is solved. I corrected bshrate.sql files path of dbaccess line .
But rc=127 problem is not solved. this scripts like bellow:
boytas:/home/baan#more shema.sh
. /home/baan/.profile
dbschema -d baan -t ttfgld418400 -ss >> /home/hamdi/statistic/tfgld418.txt

when running crontab returned rc=127 error in log file

thanks for help
34

Re: what does mean crontab Error rc=255 and rc=127

dbschema is as you know informix specific command. Maybe you should use full path to
dbschema ( I think $INFORMIXDIR/bin/dbschema ).

rc=127 could also mean that binary file
cannot be found.

See this:
root@samson:/ --> something_wrong
sh: something_wrong: not found.
root@samson:/ --> echo $?
127
root@samson:/ -->

Shell cannot find script or binary named
something_wrong and return code 127.

You can check error code always with echo $?

Hope this help.

BR,

Hrvoje