Solved

cron job not writing to the log file

Posted on 2011-03-16
9
638 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
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
VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

 
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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

Suggested Solutions

Hello fellow BSD lovers, I've created a patch process for patching openjdk6 for BSD (FreeBSD specifically), although I tried to keep all BSD versions in mind when creating my patch. Welcome to OpenJDK6 on BSD First let me start with a little …
I have been running these systems for a few years now and I am just very happy with them.   I just wanted to share the manual that I have created for upgrades and other things.  Oooh yes! FreeBSD makes me happy (as a server), no maintenance and I al…
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.
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.

778 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