Operating System - Linux
1752489 Members
5806 Online
108788 Solutions
New Discussion юеВ

Re: rtc command failed (ITO)

 
Maurice Peterse
Frequent Advisor

rtc command failed (ITO)

I've had this msg in ITO:
Cron command of root with pid 1202 failed..

In the crontab i found that this had to run at that time:
1 2 * * * [ -x /usr/sbin/rtc ] && /usr/sbin/rtc -c > /dev/null 2>&1

where can i find more info about why this failed?
5 REPLIES 5
Jeffrey S. Sims
Trusted Contributor

Re: rtc command failed (ITO)

Maurice,

You could try looking in /var/log/cron and also /var/log/messages. If that doesn't help, try just executing the cron command from the command line.
See if it runs sucessfully that way.
Bill Thorsteinson
Honored Contributor

Re: rtc command failed (ITO)

If it continues to fail take the redirection off the
command. or redirect it to a file.

If redirection is off the output will be mailed to the user.
Root should be redirected to a real user.

If you redirect to a file, then you can read the output
from the file.
Maurice Peterse
Frequent Advisor

Re: rtc command failed (ITO)

When executing the command outside crontab,
it's working....

So the question is, can i find out what went wrong that time?
D. Engelen
New Member

Re: rtc command failed (ITO)

put your commands in a script that starts with

!#/bin/ksh

next schedule this script in the crontab of root.

The cronjobs are excecuted from the csh.
Managing UNIX
Jeffrey S. Sims
Trusted Contributor

Re: rtc command failed (ITO)

You should try changing the shell as suggested above, but if that doesn't work your environment variables are probably the problem. Create a script that runs the command that you want, and manually set any needed environment variables at the beginning of the script.

Hope it helps