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

Triggering the cron process

SneakyDave

Well-known member
#1
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?
 

Aayush

Well-known member
#3
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.
 

Chris D

XenForo developer
Staff member
#6
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.
 

SneakyDave

Well-known member
#7
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
 

SneakyDave

Well-known member
#10
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?
 

SneakyDave

Well-known member
#11
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.
 

SneakyDave

Well-known member
#13
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.
 

SneakyDave

Well-known member
#14
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