When running a server cron script to accomplish a task with vBulletin you will run into path issues with inluded files in included files. So insert the following code at the top of your script to solve this issue.
Once the script is functioning then add the first line to stop error reporting from cloging up your logs. vBulletin has several Constants to set that stop useles code from running, but there are still a lot of var not set errors that will arise because it's not a forum member accessing the script. Turning them off is harmless and will keep your log files from getting it out of hand. You can turn it back on to solve issues when they arise.
define('DIR', (dirname(__FILE__))); Is assuming the script is in your forum home directory. If it's in a subdirectory then just wrap it in another dirname(). define('DIR', (dirname(dirname(__FILE__)))) and again if it's in a lower directory. This will give an absolute path for every included script so the cron can access them.
Enjoy
PHP Code:
error_reporting(0);
define('THIS_SCRIPT', 'scriptname');
define('NO_REGISTER_GLOBALS', 1);
define('SKIP_SESSIONCREATE', 1);
define('SESSION_BYPASS', 1);
define('NOCOOKIES', 1);
define('DIE_QUIETLY', 1);
define('DIR', (dirname(__FILE__)));
chdir(DIR);
$globaltemplates = array();
$specialtemplates = array();
$actiontemplates = array();
$phrasegroups = array();
require_once DIR . '/global.php';