1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Cron jobs dont update automatically

Discussion in 'Troubleshooting and Problems' started by Michael J, Jul 16, 2011.

  1. Michael J

    Michael J Member

    I have currently noticed this on the Rebuild Board Totals Counter and Update Views Counters. I schedule them every minute and nothing. Their next run times remain the same. Please help!!!!
  2. Lawrence

    Lawrence Well-Known Member

    Did you select "Any" for all fields? Select Any, then Save, and then from the Controls Drop down, click Run (this will update the next run time). I tested this and it runs every minute, :)
  3. Michael J

    Michael J Member

    Hi Lawrence,

    Yes all fields are set to "Any". I have already done what you suggested and yes that does update the next run time. However, the next run time remains the same after that - i.e. the cron never runs - and the run time is not incremented.
  4. ragtek

    ragtek Guest

    Have you any entries in your error log?
  5. Michael J

    Michael J Member

    Nope no errors at all.
  6. ragtek

    ragtek Guest


    I tried this too, and it DOESN'T update the next run time.
    If you check the code, it ONLY verifies the cronjob and runs it;)
        public function actionRun()

    $entryId $this->_input->filterSingle('entry_id'XenForo_Input::STRING);
    $entry $this->_getCronEntryOrError($entryId);

    $this->_getCronModel()->runEntry($entry); // TODO: capture output or something more useful

    return $this->responseMessage(new XenForo_Phrase('cron_entry_run_successfully'));

    // cronmodel->runEntry:

        * Runs the given entry if possible.
        * @param array $entry Info about cron entry
    public function runEntry(array $entry)
            if (
    XenForo_Application::autoload($entry['cron_class']) && method_exists($entry['cron_class'], $entry['cron_method']))
    call_user_func(array($entry['cron_class'], $entry['cron_method']));
    the next runtime is being rebuild in XenForo_Cron->run()
  7. Michael J

    Michael J Member

    Interesting. But i'm surprised no one else has seen this?
  8. Lawrence

    Lawrence Well-Known Member

    When selecting Any, and then his save, the next run time would still be what ever it was scheduled for, so to update this I selected the Run command from the Controls menu, and it did update it to show that is is scheduled to run on the next upcoming minute.

    I also highlighted all the minutes and saved it too, immediately ran the cron job and the update counters executed every minute (I had to refresh my forum page a lot to test this, :p )

    EDIT: As I put the cron back to the original default value a while ago, it was scheduled to run in 55 minutes. I just changed it to Any, ran the job, and now it shows the next scheduled time to run within the minute.
  9. ragtek

    ragtek Guest

    yes, but that's because it runs regular and not because you clicked on run;)

    it would also be fine to only refresh the page, because the "cron image" is also in the acp footer
    <div id="copyright">
            {xen:phrase xenforo_copyright}
            <xen:if is="{$cronLink}"><img src="{$cronLink}" width="1" height="1" alt="" /></xen:if>

    So it runs regular and that's why the time is refreshed^^

    Edit: hm, now i'm not sure if we're talking about the same [​IMG]
  10. Michael J

    Michael J Member

    Well my next run time only updates when i click Save not when i Run the cron. After that it never runs again. I have tried selecting all the mins as well - still no luck. I seriously cannot figure out what i've done wrong.
  11. Jake Hakoda Shirley

    Jake Hakoda Shirley Active Member

    Hey, I am having a similar issue. My cron jobs seem to randomly stop updating them selves. In this picture that I took this morning (~8:45 AM Aug. 18), you can see that most of the cron entries are still scheduled to next be run yesterday:

    The two at the bottom that I selected I just recently manually ran. Any ideas?
  12. Mike

    Mike XenForo Developer Staff Member

    Disable one cron and then re-enable it. Then you can refresh the page a few times.

    However, note that this is generally caused by a cron entry triggering a fatal error. I note a number of crons from add-ons there so one of those may trigger it. You'll need to verify that the crons are running automatically. (1.2.1 will help this issue.)

Share This Page