Triggering the cron process

SneakyDave

Well-known member
I realized that the cron functions of a XenForo installation won't trigger on time if there are no visitors to a web site, which makes sense I guess because it would require the index.php script to executed in order to see if there are any cron entries to run.

To force the cron events to fire, can I just set a "real" cron to visit the web site during down time to make sure those cron activities get fired when I want them to?
 
Crontabs in shell are the only way to go as far as I know. Or maybe you could have another web service ping your website at regular intervals but that again would be using cron tabs to implement something like that.
 
Pinging index.php wont help, because the actual defer is executed in deferred.php which is called via javascript, you will have to ping http://yoursite.com/deferred.php
 
The solution I posted above works.

Crons are launched via a deferred task. Hit deferred.php as described in my link above, and your crons (and any associated tasks) will run, unattended.
 
I'll have to take a look at this a little more closely. I have an add-on that I thought was running via this solution, but it's actually erroring out for some reason. Thanks Chris
 
Yeah, I can get it to execute via defer.php, but there is some error happening just that I'm trying to track down. Thanks.

It isn't necessary to PAGE_CONTAINER to remove the call to:
Code:
{xen:if $hasAutoDeferred, RunDeferred}

Is it? You'd only have to remove that if you were getting too many calls to defer.php, right?
 
Never mind, the error I'm getting is a permission problem, the cron isn't running as the same user as the web server userid, so I just need to make sure the same one is running there.
 
Well, no, that's not it, the cron process it just hitting the defer.php script, it doesn't have any connection to the add-on running, which should be the web server user. I'll have to just shut up and dig into it some more.
 
As an update, running deferred.php from cron works great, my errors were just permission based due to a recent upgrade, nothing to do with deferred.php or running it from shell.

I/O error - Incompetent Operator
 
Top Bottom