Solved

cron job not writing to the log file

Posted on 2011-03-16
9
641 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
Independent Software Vendors: 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

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!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
OpenLDAP Proxy to Active Directy 6 578
NTP Server in VMware 5 465
Bash Script to Analyze Oracle Schemas 11 128
UNIX Script. Send email if failure 8 93
Java performance on Solaris - Managing CPUs There are various resource controls in operating system which directly/indirectly influence the performance of application. one of the most important resource controls is "CPU".   In a multithreaded…
FreeBSD on EC2 FreeBSD (https://www.freebsd.org) is a robust Unix-like operating system that has been around for many years. FreeBSD is available on Amazon EC2 through Amazon Machine Images (AMIs) provided by FreeBSD developer and security office…
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…
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

738 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