redhat linux cron not creating log files

snowdog_2112
snowdog_2112 used Ask the Experts™
on
RHEL5 box.
several jobs in crontab -l
They appear to be running fine.  The service is running, and a test "0/2 * * * * echo "test" >> /tmp/test.txt" works as expected.

There are no logs for cron in /var/log

Any idea how to configure logging for cron?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Kerem ERSOYPresident

Commented:
Hi,

RHEL 5 has a different approach to cron for root. So crontab -l would return you nothing. It uses a a configuration file called /etc/crontab and several directories /etc/cron.hourly, /etc/cron.weekly, /etc/cron.monthly and a director called /etc/cron.d/ which will include several files to define different jobs.

You should check these places and place your jobs there. Alsso the log is there at /var/log/cron.

Please check this document for customization:

http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/6/html/Deployment_Guide/ch-Automated_Tasks.html

Cheers,
K.

Author

Commented:
I see the jobs in crontab -l and in those folders - that's not my problem.

What I'm *not* getting is the cron log files in /var/log.

I have another RHEL5 using the same distro and that box *is* logging - even when it doesn't do anything but look for the hourly/daily tasks.

My problem box seems to be running the cron tasks, but I'm not getting the "usual" cron, cron.1, cron.2 log files in /var/log.

Thanks.
Kerem ERSOYPresident

Commented:
Ok then your problem is not with cron but logging. Please check the contents of your /etc/syslog.conf and see if you have :

cron.*                                                  /var/log/cron

line and it is not commented out. If you already have the file please issue this command:

touch /var/log/cron

and restart the syslog service

service syslogd restart.

Cheers,
K.
Should you be charging more for IT Services?

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

Author

Commented:
Well now this is interesting...

no syslog.conf file in /etc.

# service syslogd status
syslogd: unrecognized service

Could be an issue?
The command is
service syslog status
not service syslogd status

execute
# service syslog status
syslogd (pid 2375) is running...
klogd (pid 2380) is running...

if don't get the output as indicated above then we will dig further...
however you may look into /etc/init.d/syslog script to locate the conf file..

good luck...
no pid for syslog

service syslog start
service syslog status

still no pid...

Author

Commented:
No answer found.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial