Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.6 > vBulletin 3.6 Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Schedule vB's tasks with a host crontab Details »»
Schedule vB's tasks with a host crontab
Version: 1.00, by Nxs Nxs is offline
Developer Last Online: Feb 2011 Show Printable Version Email this Page

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
  1. Download the attached file and edit the variables at the top to match your forum installation
  2. Upload the file to somewhere on your host
  3. 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.)
Code:
15 * * * * /usr/bin/php -f /home/myuser/exec-cron.php >/dev/null 2>&1
Detailed Information
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.

Comments
  #2  
Old 07-31-2006, 03:44 PM
Nxs's Avatar
Nxs Nxs is offline
 
Join Date: May 2004
Posts: 79
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #3  
Old 07-31-2006, 04:19 PM
Evercraft Evercraft is offline
 
Join Date: Jan 2005
Location: United Kingdom
Posts: 107
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Very nice!
Reply With Quote
  #4  
Old 08-01-2006, 07:18 AM
Milad's Avatar
Milad Milad is offline
 
Join Date: Apr 2005
Location: Syro
Posts: 663
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

very good work

Now vBulletin has real cronjop
Reply With Quote
  #5  
Old 08-01-2006, 07:44 AM
Nxs's Avatar
Nxs Nxs is offline
 
Join Date: May 2004
Posts: 79
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Milad
very good work

Now vBulletin has real cronjop
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.
Reply With Quote
  #6  
Old 03-29-2007, 04:50 PM
jmw jmw is offline
 
Join Date: Jan 2005
Posts: 71
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Does this work with 3.6.5? It appears the "15 minute after the hour" example has the file name backwards.
Reply With Quote
  #7  
Old 05-04-2007, 04:53 PM
dooch dooch is offline
 
Join Date: Dec 2005
Posts: 126
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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. ;) 
Nice work dude!

INSTALLED

Thanks

Dooch
Reply With Quote
  #8  
Old 05-06-2007, 07:27 AM
NiTRoN NiTRoN is offline
 
Join Date: Dec 2005
Location: Big Ditch
Posts: 95
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Sweet this is excellent for small boards.. I've been waiting sooooooo loooooong for this..
Reply With Quote
  #9  
Old 06-27-2007, 03:04 PM
trilljester's Avatar
trilljester trilljester is offline
 
Join Date: Jul 2005
Posts: 151
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.

Thanks!
Reply With Quote
  #10  
Old 07-24-2007, 07:40 PM
gamma912 gamma912 is offline
 
Join Date: Feb 2007
Posts: 9
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

yea thats true - Thanks Im using it now it works great
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05079 seconds
  • Memory Usage 2,300KB
  • Queries Executed 23 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)bbcode_code
  • (1)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete