1

I have a cron task that calls a special PHP script via wget. Here is the crontab entry:

0 * * * * wget http://www....

It will work perfect for several days, running on the hour. However, after a few days the cron job will start to be called several times an hour. I have never seen CRON drift like this, so I imagine it can't really be a CRON issue. However, the logs of the script that is called clearly show it running several times an hour.

Server details:

  • Ubuntu Luci
  • Apache
  • MySQL
  • PHP5
  • Time is showing correct @ command line
  • Server is setup to sync with a NTP server

In order for the script to run it must be passed a unique 50-character hash key in the URL, so this script isn't being called from any other source accidentally.

What might cause CRON to drift like this?

  • 1
    You say "the logs of the script that is called", but what about the logs of the cron job? – Paused until further notice. May 6 '10 at 22:28
2

I'd guess that it's not completing for whatever reason and eventually spawns multiple processes.

What's the script in full?

What's the log output?

Provide complete and intimate details regarding why you believe what you do. If you're running a common cron daemon, I'd think it more likely that you're misinterpreting the situation.

It sounds like you may be basing this theory off the access logs. If so, you could wrap wget in a script and enable additional system level logging, which could more intimately detail the behavior. But I'm guessing, as you don't provide full details.

  • @Warner - Outstanding point. I'll add some system level logging and report back. – Justin May 6 '10 at 22:27
  • To be specific - the wget command was timing out and trying again. – Justin May 10 '10 at 2:20

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.