1833493 Members
3048 Online
110052 Solutions
New Discussion

Re: Cron

 
Claire Daelman
Advisor

Cron

We have this alarm on a server S16K-A, Hp-UX 9000, 11.11:
Cron command of root with pid XXX failed

I have no more information, this alarm occured regulary but I can't find with wich cron command it's linked.

Thanks,
Claire
11 REPLIES 11
A. Clay Stephenson
Acclaimed Contributor

Re: Cron

The first thing to do is login as root and do a crontab -l. This will list all of root's crontab entries to stdout. With any luck, there will be only a few entries (maybe even one) with matching time specifications.
If it ain't broke, I can fix that.
Claire Daelman
Advisor

Re: Cron

Hello,

the problem is that's a production server and we have lot of entries. That's why I can't now which command generates this error.
Martin Johnson
Honored Contributor

Re: Cron

If you have the output of the cron entries redirected to a logfile, check the logfile(s) for possible errors. If the output is not redirected to a file (it is redirected to /dev/null) modify the cron entries to redirect to a logfile and examine the logfile (one unique logfile for each cron entry).


HTH
Marty
Sridhar Bhaskarla
Honored Contributor

Re: Cron

Atleast you can look at /var/adm/cron/log file and search for this pid. The line that starts with CMD gives you the script/command it started through cron with this pid.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Rich Wright
Trusted Contributor

Re: Cron

Look at /var/adm/cron/log file for any clues.
James R. Ferguson
Acclaimed Contributor

Re: Cron

Hi:

Given Clay's first suggestion, I would think that between the tasks associated with 'root' (via 'crontab -l') and the 'var/adm/cron/log' history, that you should be able to match the failure with the task.

Have you tried that?

Regards!

...JRF...
A. Clay Stephenson
Acclaimed Contributor

Re: Cron

Ok, Plan B. Look in /var/adm/cron/log for matching PID's.

If Plan B fails then Plan C. Back to the original method. Use crontab -l to find the subset of possible culprits and then start each one that's ok to run now with at.
e.g.
at -f /root/bin/myscript.sh now

The reason you need to do this via at rather than simply running it from the shell is that you want to duplicate cron's sparse runtime environment.
If it ain't broke, I can fix that.
Claire Daelman
Advisor

Re: Cron

Thanks. In fact, we have a problem with cronification of backup and it's the cell server that's why we have so many alarms.
Claire Daelman
Advisor

Re: Cron

Thanks a lot to everybody. Thanks A.Clay for funny answers...
Martin Johnson
Honored Contributor

Re: Cron

A. Clay,

Were your answers meant to be funny? If so, they sure went over MY head!

:-)
Marty
A. Clay Stephenson
Acclaimed Contributor

Re: Cron

Beats me too. I had no idea I was being funny; silly me, I thought I was giving perfectly straightforward answers.
If it ain't broke, I can fix that.