Solved

cron job not writing to the log file

Posted on 2011-03-16
9
633 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
  • 4
  • 3
  • 2
9 Comments
 
LVL 3

Expert Comment

by:Abhishek_Chib
Comment Utility
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
Comment Utility
And also do some basic trouble shooting :

Reference :

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

0
 

Author Comment

by:orazen12
Comment Utility
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
 
LVL 3

Expert Comment

by:Abhishek_Chib
Comment Utility
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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

Author Comment

by:orazen12
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
k, I'm not a linux expert...
but ifthat worked for you... great...
0
 

Author Closing Comment

by:orazen12
Comment Utility
The service provider told me this solution.
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

Let's say you need to move the data of a file system from one partition to another. This generally involves dismounting the file system, backing it up to tapes, and restoring it to a new partition. You may also copy the file system from one place to…
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 several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

743 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now