1825759 Members
2188 Online
109687 Solutions
New Discussion

At command error rc=127

 
Dewa Negara_4
Regular Advisor

At command error rc=127

Hi All,

Anyone can help me to resolve the issue below please. Everytime I run at command below, I always got an error rc=127. This actually happen on my SUN SOlaris server.But I believe this is similar to HPUX.

[root@SUN_TEST:/etc/cron.d]
# su - SECUIOA -c "/bin/at -f /tmp/test.sh now"

[root@SUN_TEST:/var/cron]
# tail log
> CMD: 1145753543.a
> SECUIOA 12013 a Sat Apr 22 20:52:23 2006
< SECUIOA 12013 a Sat Apr 22 20:52:23 2006 rc=127


Please help. High score will be given.

Thanks and Best Regards,
Dewa
Santos
3 REPLIES 3
Steven E. Protter
Exalted Contributor

Re: At command error rc=127

Shalom,

Your cron job is getting a return code other than zero when it runs.

That means it is encoutering an error.

I recommend the following:

add this near the beginning of the script:

set -x

Perhaps change cron to redirect the output to a file so you can see this verbose output.

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
Darrel Louis
Honored Contributor

Re: At command error rc=127

Hi Dewa,

As Steven already mentioned, redirect the output to a logfile.

The error message means:
rc=127 is saying that you are trying to use the non-shell commands.

Are you sourcing scripts/commands from the test.sh script.
Also check if your PATH variables are correct if you are using commands whitout specifying the full-path.

GoodLuck

Darrel Louis
Colin Topliss
Esteemed Contributor

Re: At command error rc=127

I had this recently. Had me stumped for at least 10 minutes.....

Someone had added a cron entry with the wrong number of parameters....

00 23 * * * 0-6

instead of

00 23 * * *

So, double check your man page and make sure you have the correct number of parameters!

If it isn't that, on your cron command line just redirect the script output to a log file . Check the contents of the log file and it may indicate your problem.

Col