Operating System - HP-UX
1822934 Members
3732 Online
109645 Solutions
New Discussion юеВ

Re: cron log file gets delete automatically

 
sahir_1
Frequent Advisor

cron log file gets delete automatically

Hi guys,

I am facing an issue on HPUX 11.11 that /var/adm/cron/log file gets delete automatically when cron tries to write anything on it..following is the error generated is as follows

Jul 27 23:31:28 a1124016 syslog: STD-0382: cron process died on a1124016 more than 3 times in 24 hours

cron is still running on the box

a1124016:sk1798 ps -ef | grep -i cron
root 26613 1 0 23:31:09 ? 0:00 /usr/sbin/cron
root 8134 9985 2 23:54:15 pts/3 0:00 grep -i cron


Please help me to solve this at the earlist..

Any reply will be highly appreciated.

Thanks,

Sahir
8 REPLIES 8
Basheer_2
Trusted Contributor

Re: cron log file gets delete automatically

Hello Sahir,

This is very very strange.
what does crontab -l

is there any process or cron job that does this.

have you updated your sys with the latest patches. specially the cron patches.

can you kill yoursel the cron job and restart and see if this stops.

any other messages in /var/adm/syslog/syslog.log
and also in cron.log


sahir_1
Frequent Advisor

Re: cron log file gets delete automatically

Hi Basheer,

Now I found one more thing that cron logs are updating in OLDlog. I dont know how it got changed. Any settings can be done for setting the cron log..???
Din_1
Frequent Advisor

Re: cron log file gets delete automatically

Hi Sahir,

I think somewhere we need to redirect the logs. Let me find it and inform you...

Rgds,
Din
rariasn
Honored Contributor

Re: cron log file gets delete automatically

Hi Sahir,

Verify next files:

/sbin/init.d/cron
/var/adm/cron/cron.allow

and users crontabs in:

/var/spool/cron/crontabs

man cron

rgs,
sahir_1
Frequent Advisor

Re: cron log file gets delete automatically

There is nothing to do...

Actual problem was somebody renamed log files to OLDlog.. This was the reason, I renamed to log and problem resolved.

rariasn
Honored Contributor

Re: cron log file gets delete automatically

Hi,

Verify permission for log files

-rw-r--r-- 1 root root 0 Jun 6 03:44 OLDlog
-rw-r--r-- 1 root root 0 Jun 13 03:45 log

rgs,
Bill Hassell
Honored Contributor

Re: cron log file gets delete automatically

cron (like syslogd and others) always keeps the log file open. Renaming the file does nothing but change the name. Once a file is open, you can even remove the file and the program will keep writing to the file. The file is simply marked for removal once all the links to the file are gone.


Bill Hassell, sysadmin
sahir_1
Frequent Advisor

Re: cron log file gets delete automatically

problem is solved by renaming log file. Thanks for all support