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
  • How have you notived that the cron is running in a 15 minutes interval? – René Höhle 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

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.

  • +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

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.


Hope this helps you.

  • 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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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