Log in

View Full Version : How to run vB's cron jobs on forums with low users ?


Nxs
07-28-2006, 05:58 PM
I expect the forums I run to sometimes go a full day with any visitors

vBulletins schedule tasks are run when the forums are accessed (i guess it checks the time and runs any that should have been run at that point)

One of these scheduled tasks is to pull information from the RSS feeds you subscribe to (vB 3.6) but one of the feeds I subscribe to only retains 10 news items, it is possible that on a day the forum has no users - posts that should be picked up by the RSS scheduled task are missed as they have flowed through the chain and are now lost.

So, i'm looking for a way to get a linux cron job to wake up vBulletin's scheduled tasks every hour.

After talking with my host and logging a vB support ticked - im still at square 1 and could use some help.

From a SSH (testing)
/pathtophp/php -f /pathtoforums/forums/cron.php
returns a few characters of garbage, but the RSS import is not run

wget http://www.mysite.com/forums/cron.php
downloads the same few characters of garbage to a file, again the RSS import is not run

the nice vB staff then sugested calling the rssimporter php file directly - but this does import anything when run

Any ideas / clues from the pro's here ? I'm surer there are other forums out there that will soon suffer the same problems when they try to import a fast moving RSS source into a slow moving forum.

Nxs
07-30-2006, 01:36 PM
Did some more testing with this today, and found out that my attempts above did infact work (to some extent) so using either of the following works

cd /pathtoforums; /usr/bin/php -f cron.php
wget http://urlofforums/cron.php


it looks like calling "cron.php" will only process the next scheduled task.So if you have 3 tasks waiting (and the 3rd is your RSS import) you will need to run access the "cron.php" file three times.

Marco van Herwaarden
07-30-2006, 03:50 PM
What about wget of your forum index.php page?

That is the page that should trigger (or better the footer, so a different member page should also work) the scheduled tasks.

Paul M
07-30-2006, 03:56 PM
it looks like calling "cron.php" will only process the next scheduled task.So if you have 3 tasks waiting (and the 3rd is your RSS import) you will need to run access the "cron.php" file three times.That's correct, only the next task is processed by a call.

Nxs
07-30-2006, 05:06 PM
That's correct, only the next task is processed by a call.

Well problem solved now, knocked up a short PHP script to run through the scheduled task database and call cron.php for those which should have run. Just need to pop this as a cronjob on my host and the problem has gone away.