This works for me using vB 3.8.3
save the code below into a script file named vbcronjob.sh, and call the script from cron (I schedule my crontab for once a minute). Be sure to chmod +x the script. The logic in this shell script is pretty much the same as in the cron-exec.php script you can download here.
you should also disable the cron image inserted at the bottom of the pages presented to your users. See
This Mod for a simple plugin to do that.
Code:
#!/bin/bash
#----- environment setup -----#
# Absolute path to vBulletin root (where cron.php is located)
ct_pathtoforum='/home/user/public_html/forum/'
# Max tasks to run on one pass
ct_max=10
#----- database setup -----#
ct_dbhost='localhost' # your MySQL Server
ct_dbport='3306' # your MySQL Port
ct_dbname='forum' # your vBulletin database
ct_dbuser='username' # user with READ access
ct_dbpass='password' # password for the above user
ct_dbprefix='' # database prefix, if required
#----- query execution ----#
ct_date=`date "+%s"` # current unix time
ct_connect="--protocol=socket -h$ct_dbhost -P$ct_dbport -u$ct_dbuser -p$ct_dbpass -D$ct_dbname"
ct_query="SELECT COUNT(*) FROM ${ct_dbprefix}cron WHERE active=1 AND nextrun < $ct_date;"
# -A, No automatic rehashing, gives quicker start.
# -B, Batch mode.
# -N, Don't write column names.
# -n, Flush buffer.
# -q, Don't cache.
# -r, Write raw fields.
# -e, Execute command and quit.
ct_repeat=`mysql $ct_connect -A -B -N -n -q -r -e"$ct_query"`
#----- cron execution ----#
ct_pathtophp=`which php` # path to PHP
cd $ct_pathtoforum
if [ "$ct_repeat" -gt "$ct_max" ]; then ct_repeat=$ct_max; fi
for ((i=0; ct_repeat>i; i++)); do
#echo "$i"
$ct_pathtophp ./cron.php >& /dev/null
sleep 5
done
exit 0