The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Execute Scheduled Tasks Via Crontab Details »» | |||||||||||||||||||||||||
This product will run your scheduled tasks via crontab rather than the current method where Vbulletin uses an image to execute tasks. This can slow down a users experience especially with long running tasks. It also stops all of those cron.php entries in your webserver log.
This product is really only useful for those on *nix (Linux/Unix/Etc) servers. Will not work on Windows based servers. You should have a rudimentary understanding of crontab before installing this hack. For those wondering how this differs from this hack, well, first of all, it works for 3.6.8, but more importantly it actually replaces the method Vbulletin uses to execute scheduled tasks, whereas the other hack only helps it out. Please Click Install! Brought To You By WorldWideCreations.com. Show Your Support
|
Comments |
#12
|
|||
|
|||
Don't see why it wouldn't, but I for one will not modify any plugin for a beta. When it is released, then I consider it.
|
#13
|
|||
|
|||
Quote:
I like the idea of using this instead of vbulletins built in cron tasks. Thanks, Jason |
#14
|
|||
|
|||
No I don't consider it a release. You are always free to try it yourself.
|
#15
|
|||
|
|||
Unless they have seriously changed the way scheduled tasks are done, I don't see how it would not work in the latest beta versions.
|
#16
|
||||
|
||||
Can this increase server load? My webhost just contacted me saying that cron.php among other scripts were using too much cpu.
|
#17
|
|||
|
|||
Not this mod. This mod just calls cron.php just like it normally would except on an exact schedule. It could be you have a scheduled task that is using a lot of CPU though.
|
#18
|
|||
|
|||
I have been using this mod for quite some time (clicked install over a year ago) now, and always lived with vBulletin cron tasks running one at a time when the linux cron ran once a minute.
But last week I got ambitious and dug into the bash shell to write this script that runs all the tasks scheduled for any any particular minute, instead of allowing them to sit in 'backlog' until the next minute. 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 |
#19
|
|||
|
|||
Why not just use:
/usr/bin/php /home/username/public_html/forum/cron.php >& /dev/null ??? |
#20
|
|||
|
|||
Because then you are still displaying the cron.php image..
|
#21
|
|||
|
|||
Ah, I understand what you are saying. But I still think it is better to call the /usr/bin/php directly rather than using a .SH script that does the exact same thing.
But of course, the product XML would have to be loaded to remove the $cronimage from displaying. |
Thread Tools | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|