Solved

cron job not writing to the log file

Posted on 2011-03-16
9
646 Views
Last Modified: 2012-06-27
Hi,
I have a question about crontab in CentOS. Two days ago I upgraded my server and a few settings got changed. Now the cron job is writing to the log file. I asked the service provider and they said they will not be able to help me with that. I'm using a VPS.

Please let me know how to enable logging in cron.

Thanks.
0
Comment
Question by:orazen12
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 2
9 Comments
 
LVL 3

Expert Comment

by:Abhishek_Chib
ID: 35154155
Hi,

Your question is not cleared.

1. crond is not working ?
2. If it is working then /var/log/cron file not updating ?
3. You schedule some cron but schedule cron not updating the file user specific logs ?

0
 
LVL 3

Expert Comment

by:Abhishek_Chib
ID: 35154164
And also do some basic trouble shooting :

Reference :

http://aplawrence.com/Unixart/crontab_not_running.html

0
 

Author Comment

by:orazen12
ID: 35154219
Sorry for not being clear.
Cron is working. The job is run. What I need is that it should write the same to the log file that it ran which job at which time. The log file is empty even though the job is run.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 3

Expert Comment

by:Abhishek_Chib
ID: 35154299
Hi,

First I will prefer, to do some troubleshooting, please follow URL :

http://aplawrence.com/Unixart/crontab_not_running.html

and finally restart the service, check the disk space include inode
0
 

Author Comment

by:orazen12
ID: 35154613
Well....I did go through it and am not sure what to do from there.

I even restarted the service. It is still not writing to the log file at /var/log/cron (cron being the file name).

0
 
LVL 6

Expert Comment

by:Tomunique
ID: 35156304
check syslog config

in our case: /etc/syslog-ng/syslog-ng.conf

I found these lines on our system:
filter f_cron       { facility(cron); };
#destination cron { file("/var/log/cron"); };
#log { source(src); filter(f_cron); destination(cron); };

you'd want yours uncommneted.
0
 

Accepted Solution

by:
orazen12 earned 0 total points
ID: 35163193
Tomunique
I could not find the syslog file. Sorry I'm new at this. But I got it working by another approach. I had to start the service rsyslog. The service was stopped. The moment I did that it started working. So I used the command

/sbin/service rsyslog start

Thanks.
0
 
LVL 6

Expert Comment

by:Tomunique
ID: 35164800
k, I'm not a linux expert...
but ifthat worked for you... great...
0
 

Author Closing Comment

by:orazen12
ID: 35187543
The service provider told me this solution.
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In tuning file systems on the Solaris Operating System, changing some parameters of a file system usually destroys the data on it. For instance, changing the cache segment block size in the volume of a T3 requires that you delete the existing volu…
Using libpcap/Jpcap to capture and send packets on Solaris version (10/11) Library used: 1.      Libpcap (http://www.tcpdump.org) Version 1.2 2.      Jpcap(http://netresearch.ics.uci.edu/kfujii/Jpcap/doc/index.html) Version 0.6 Prerequisite: 1.      GCC …
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question