1833871 Members
1818 Online
110063 Solutions
New Discussion

Re: Problem with cron

 
Richard Davies_6
Occasional Contributor

Problem with cron

cron on one of the hpux 10.20 servers I look after has decided to stop sending emails to the root account. I reboot the server last night to see if that would sort out the problem, but no such luck. Any suggestions?

Thanks

Richard
12 REPLIES 12
Mark Grant
Honored Contributor

Re: Problem with cron

Firstly, check what is happening in /var/adm/cron/log. Also, check that cron is actually running. Let us know what you find.
Never preceed any demonstration with anything more predictive than "watch this"
Stefan Farrelly
Honored Contributor

Re: Problem with cron

emails not going to root account sounds like a syslogd problem. Try restarting syslogd (/sbin/init.d/syslog stop then start).

If this doesnt fix it is sendmail running ?
ps -aef|grep -i sendmail
Im from Palmerston North, New Zealand, but somehow ended up in London...
Richard Davies_6
Occasional Contributor

Re: Problem with cron

Part of the contents of /var/adm/cron/log

hpehq1>more log
! *** cron started *** pid = 2709 Thu Oct 16 20:18:03 BST 2003
> CMD: /usr/lbin/sa/sa1
> root 4907 c Thu Oct 16 21:00:00 BST 2003
< root 4907 c Thu Oct 16 21:00:00 BST 2003
> CMD: /usr/local/bin/backup_openmail
> root 7027 c Thu Oct 16 22:00:00 BST 2003
> CMD: /var/trend/smom12/install_ptn
> root 7028 c Thu Oct 16 22:00:00 BST 2003
Elmar P. Kolkman
Honored Contributor

Re: Problem with cron

Another reason could be a mail problem, for instance a changed mode of the /var/mail directory. Check you syslog.log and mail.log file for sendmail logging for relevant info.

And of course: .forward and aliases could result in mail sent to a wrong account, resulting in you missing the mail.
Every problem has at least one solution. Only some solutions are harder to find.
Keith Bevan_1
Trusted Contributor

Re: Problem with cron

Richard,

For 'belt and braces' you could also force the cron to refresh its lookup of the crontab file by doing a crontab -e and the quitting without making any amendments.

Keith
You are either part of the solution or part of the problem
Richard Davies_6
Occasional Contributor

Re: Problem with cron

syslogd is running as is sendmail. In fact the server is an email server, so I would know quick enough from users if sendmail was not running.
Mark Grant
Honored Contributor

Re: Problem with cron

Richard,

Do you mean your cron job is sending mails or that the cron job is producing output that cron mail (becuase that it's default behaviour).

In either case, it would be worth running the job from the command line to see what happens.
Never preceed any demonstration with anything more predictive than "watch this"
Richard Davies_6
Occasional Contributor

Re: Problem with cron

Mark

cron is not emailing the output from the cron job. It has worked fine for over 3 years I have been looking after this server, and stopped over last weekend.
Mark Grant
Honored Contributor

Re: Problem with cron

I assume that you are sure that the job is still produciong some output.

I would log in as the user this job runs as within cron and send an e-mail using the "mail" command to root and see if that succeeds.
Never preceed any demonstration with anything more predictive than "watch this"
Elmar P. Kolkman
Honored Contributor

Re: Problem with cron

Are you sure the job finishes? Because the mail is not send before the cronjob finishes.

To test if the problem is job or server/cron/sendmail related, you could add a job to your crontab that surely sends output, for instance an echo.
Every problem has at least one solution. Only some solutions are harder to find.
Camel_1
Valued Contributor

Re: Problem with cron

Did you redirect the cron job to any log files or /dev/null?
Stuart Urquhart
Frequent Advisor

Re: Problem with cron

Short of space on /var ? Check mailq to see if mail is being queued not delivered. What does it say in /var/adm/syslog/mail.log ?

Does /usr/lib/sendmail -v root < /dev/null work OK ?