Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have the following cron in my crontab:

0 5 * * * wget -q -O /dev/null http://www.mysite.com/crontask.php

From what I understand, this is to run at 5am every day and only once. However, I have noticed JUST today that it is running every 15 minutes from 5am. I did edit the crontab yesterday on a different cron job so i'm wondering if perhaps that has caused some sort of knock-on effect which make the system interpret the line above different when it 'installed'.

Running Centos.

As a responce to a query below. Here is a sample of the apache log (notice the incorrect time). I have masked the server IP address for security:

SERVERIPADDRESS - - [02/Mar/2011:05:15:04 +0000] "GET /crontask.php HTTP/1.0" 200 523 "-" "Wget/1.11.4 Red Hat modified" www.mysite.com

Here is the original:

SERVERIPADDRESS - - [02/Mar/2011:05:00:02 +0000] "GET /crontask.php HTTP/1.0" 200 523 "-" "Wget/1.11.4 Red Hat modified" www.mysite.com
share|improve this question
    
How have you notived that the cron is running in a 15 minutes interval? –  Stony Mar 2 '11 at 10:29
    
@Stony I checked out the apache access logs –  David Mar 2 '11 at 10:51
1  
If you found answers elsewhere, you can post and accept answers to your own questions. –  Dennis Williamson Mar 2 '11 at 11:10
add comment

2 Answers

up vote 3 down vote accepted

Pablo's answer above makes great sense to me. It would also be helpful to check what cron is logging about this job. On an unmodified CentOS box, cron should log in /var/log/cron, so you should have some record of whether it's your job running at other intervals, or someone else's cron kicking this off.

If this file doesn't exist, your syslog.conf setup may be non-standard. Assuming it's not, you should see an entry like

Mar  2 05:00:01 servername crond[xxxxx]: (root) CMD (wget -q -O /dev/null http://www.mysite.com/crontask.php)

Do you see that, and what other comparable entries do you see?

In addition, and please forgive the comment, but I notice that in your time on SF, you've asked six questions and accepted the answers for none. Local etiquette is that you should accept the most-satisfactory answer for each question you ask, after a suitable period, by clicking on the tick outline next to the answer, and this helps drive the SF reputation system. It may be that none of your questions has a satisfactory answer, in which case I apologise for mentioning this; but we all see a red logo by your userID saying "0% accept rate", and this may discourage others from answering your questions in future. If you had a moment to revisit your earlier questions and review the answers, it would be helpful.

share|improve this answer
    
+1 for additional info and etiquette –  pablo Mar 2 '11 at 10:51
    
Thanks for the feedback. Oddly, the cron log says that the cron was only ran at 5am...so that conflicts with the apache access log (and the cron activity)... –  David Mar 2 '11 at 11:00
    
I think it's fair to say that it conflicts with the apache access log, but I'm not sure you can be confident that cron was running it, if the cron logs don't say it was. Could we see the apache logs? We are starting to find reasons to suspect that other mechanisms are responsible for those. –  MadHatter Mar 2 '11 at 11:03
    
@MadHatter thanks for the suggestion, I have added a line from the apache log. –  David Mar 2 '11 at 11:10
    
Could you add the 0500 (correct) line for comparison? If you mask the server address again, please confirm that they're the same masked address in each case (not "localhost" in one). –  MadHatter Mar 2 '11 at 11:14
show 6 more comments

Your cron looks correct to me.

I would guess there is another cron on your system that might be calling this.

Check /etc/crontab and /var/spool/cron

It may be there is a cron running as another user account.

http://www.centos.org/docs/5/html/Deployment_Guide-en-US/ch-autotasks.html

Hope this helps you.

share|improve this answer
    
Thanks for the reply. I have checked and everything looks fine there. –  David Mar 2 '11 at 10:37
    
Have you tried restarting cron? /etc/init.d/crond restart –  pablo Mar 2 '11 at 11:57
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.