Version: 1.00, by Nxs
Developer Last Online: Feb 2011
Category: Administrative and Maintenance Tools -
Version: 3.6.0 RC3
Rating:
Released: 07-30-2006
Last Update: Never
Installs: 24
Additional Files
No support by the author.
Schedule vB's tasks with a host crontab
!!! Warning You run this script at your OWN risk, I will not be responsible for any damage caused !!!
Description:
vBulletins schedule tasks only run when a user is browsing your forum. With the release of 3.6 and RSS imports this has caused problems for slow moving forums importing fast moving RSS feeds (If a news item passes fully through the RSS feed before a visitor browses your forums causing the import to be processed then content could be lost)
Solution:
If your host supports "Cron Jobs" you can call the attached PHP file periodically to force vBulletin to catch up with its internal scheduled tasks.
Installation
Download the attached file and edit the variables at the top to match your forum installation
Upload the file to somewhere on your host
Schedule this file to run at an appropriate interval
eg. (to run every hour at 15m past the hour, 12:15 - 13:15 - 14:15 - etc.)
Unfortunatly running the cron.php from the vBulletin files will only process the next pending single task, This short script simply queries the scheduled task database to count how many tasks are pending, it then calls the cron.php routine that number of times - thus your scheduled tasks are kept up to date.
This is my first ever PHP script so please don't expect a masterpiece from a rocket scientist, if anyone has any comments or suggestions please drop me a PM
Show Your Support
This modification may not be copied, reproduced or published elsewhere without author's permission.
I wasn't at all sure which forum to drop this script into, but as it relates mostly to the new RSS feature in 3.6 I guessed here was as good a place, sorry if it isn't.
Well, only if you schedule this script to run every minute - and i'm sure your host will have something to say about that
Mine just runs every hour and typicaly has about 5 or 6 jobs to run at that point if no one has visited the forums in that time, works really well for importing RSS feeds tho.
yes it does work with 3.6.5 I had to change it slightly for non-localhost connections Here is the part you need to change.
PHP Code:
$ec_localhost = "localhost"; //Dooch's Additional bit. Add your remote mysql db info her eif not localhost!
$ec_dbname = "db"; // your vBulletin database
$ec_dbuser = "user"; // user with READ access
$ec_dbpass = "passw"; // password for the above user
$ec_dbprefix = ""; // database prefix, if required
// This should be the location of your forum folder (where cron.php resides)
$ec_pathtoforum = "path";
// Specify the FULL location of your PHP installation (how to call php)
$ec_pathtophp = "/usr/bin/php";
// Maximum number of tasks to run on one pass
$ec_max = 10;
/**************************************************
**** DO NOT CHANGE THE CODE BELOW THIS LINE ****
**************************************************/
// Connect to MySQL
$ec_link = mysql_connect($ec_localhost,$ec_dbuser,$ec_dbpass); //note the change here for non-localhost dudes. ;)
This is working nicely. I can't believe that VB doesn't offer something like this to run the scheduled tasks, because without traffic, those tasks will not run. That's just stupid.