Weekly Cron Executing Every Five Minutes

User iionly recently kindly provided me with a five minute cron for the galliMassmaile. It was the only one that would work on my server in the Direct Admin control panel.

I have modified it for Log Rotate by replacing "fiveminite" with "weekly". However, when I check my Croncheck plugin the cron is executing every two minutes.

Cron is: 

/usr/bin/wget --spider --output-document=/dev/null http://www.mysite.com/elggfolder/cron/weekly/ >/dev/null 2>&1

  • that's the right url, but you need to change the pattern for when it triggers currently you have */5 for five minutes right?

    You need to change that to trigger weekly

  • No Matt, I have nothing entered in the Direct Admin panel timings fields. With the 5 min cron used for the mass mailer, I found that putting */5 caused the cron to not execute at all. I'm assuming all fields should be left as "*" except for Day of Week where I will enter "5" for today (Friday). Is that right?

    image

  • Minute          Hour    Day     Month   Weekday
    *               *       *       *       *                ------->minute

    */5             *       *       *       *               ------->fiveminute

    15,30,45,59     *       *       *       *               ------->fifteenmin


    30,59           *       *       *       *               ------->halfhour


    0               *       *       *       *               ------->hourly


    0               0       *       *       *               ------->daily


    0               0       *       *       0               ------->weekly


    0               0       1       *       *               ------->monthly


    0               0       1       1       *               ------->yearly

     

    If the */5 pattern does not work, you can try the "0,5,10,15" etc. pattern to directly give the minutes for the fiveminute cronjob.

  • Many thanks. I think I've figured it out. What was confusing Direct Admin was leaving out the "5" (today, Friday) from the Day of Week field. But inserting it confused it equally, causing the cron to fire every few minutes. So I started over. I inserted "5" in the Day of Week field then deleted "weekly" from iionly's command. Croncheck currently says:

    16 minutes ago @ Fri, 19 Apr 2013 16:12:01 -0400

    So it seems to be working properly now. People have been patient with me on this one but from what is said I wonder how many are thinking of C Panel and are not familiar with Direct Admin panel. If the weekly triggering of Log Rotate continues to work I finally have the answer and can share it with others who may be using Direct Admin. Personally I prefer it to C Panel as it's basic and uncluttered.

  • It would be worthwhile to follow-up the suggestion from DhrupDeScoop about wikipedia. There is an external reference at the bottom of the Cron page to the CronSandbox - you can try out any combination of time/date values and get back a list of future run-times.

  • (No) Progress Report:

    Well the new weekly cron command did execute once but it's now ten days later and it hasn't fired again. It's:

    * * * * 5 /usr/bin/wget --spider --output-document=/dev/null http://www.mysite.net/elgg/cron/ >/dev/null 2>&1

    I went back and studied DhrupDeScoop's table changing the frequency to:

    0 0 * * 0 /usr/bin/wget --spider --output-document=/dev/null http://www.mysite.net/elgg/cron/ >/dev/null 2>&1

    but it didn't fire last night (Sunday) at midnight as directed.

    So this continues to be a mystery to me !

  • This time it worked perfectly. Many thanks' Matt. I had tried it some time ago with the "weekly" but must have got the frequency code wrong. Finally success! Now my Elgg is pretty well perfect.