vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.6 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=194)
-   -   Administrative and Maintenance Tools - Execute Scheduled Tasks Via Crontab (https://vborg.vbsupport.ru/showthread.php?t=164477)

Jafo232 03-18-2008 01:38 PM

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.

GoodKarmaKid 03-28-2008 02:14 AM

Quote:

Originally Posted by Jafo232 (Post 1467913)
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.

Do you consider RC1 (release candidate 1) a release ? :).


I like the idea of using this instead of vbulletins built in cron tasks.


Thanks,
Jason

Jafo232 03-28-2008 01:18 PM

No I don't consider it a release. You are always free to try it yourself. :)

Jafo232 03-30-2008 03:31 PM

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.

|Jordan| 12-15-2008 05:20 PM

Can this increase server load? My webhost just contacted me saying that cron.php among other scripts were using too much cpu.

Jafo232 12-16-2008 01:44 PM

Quote:

Originally Posted by |Jordan| (Post 1685989)
Can this increase server load? My webhost just contacted me saying that cron.php among other scripts were using too much cpu.

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.

plothook 01-15-2009 04:53 PM

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


OnyxChase 04-08-2009 01:17 AM

Why not just use:

/usr/bin/php /home/username/public_html/forum/cron.php >& /dev/null

??? :)

Jafo232 04-08-2009 05:45 AM

Because then you are still displaying the cron.php image..

OnyxChase 04-08-2009 06:37 AM

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.


All times are GMT. The time now is 04:23 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.00999 seconds
  • Memory Usage 1,741KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete