Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Full Releases

Reply
 
Thread Tools
Cron job: Prune forums Details »»
Cron job: Prune forums
Version: 1.00, by jamoss jamoss is offline
Developer Last Online: Jan 2021 Show Printable Version Email this Page

Version: 2.2.x Rating:
Released: 02-11-2003 Last Update: Never Installs: 5
 
No support by the author.

If you get the kind of traffic like we do-- average 2,000 messages post per day-- you need to do a lot of pruning.

Here's a hack that will automatically run a script daily (or weekly) that will select forums to prune, choose how old the pruned threads must be, deletes the threads, then updates the thread and post counts (all configurable). Author assumes that you have access to your server's filesystem and can edit your crontab file, located in /etc

Steps:

1. Edit your crontab file (in /etc) and add one of these lines:

If you want to run it DAILY at 12:01am
01 00 * * * root /usr/local/bin/php /fullpath/to/yourboard/admin/cron_prune.php >dev/null

If you want to run it WEEKLY, every SUNDAY at 12:01am
01 00 * * 0 root /usr/local/bin/php /fullpath/to/yourboard/admin/cron_prune.php >dev/null

(replace /fullpath/to/yourboard/admin/ with the actual server path to your vB admin directory)

2. Put the attached file (cron_prune.php) in your board's admin directory.

3. Edit the cron_prune.php file and enter your own settings at the top of the file.

If you have any questions, post them here (I'll subscribe to this thread) or email me at jennifer@babynames.com

Let me know if it works for ya! It works for us!
Jenn

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 02-12-2003, 02:51 PM
PSI|Dr-X PSI|Dr-X is offline
 
Join Date: Aug 2002
Posts: 168
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I will try cuz i really need it
Reply With Quote
  #3  
Old 02-12-2003, 03:22 PM
Dean C's Avatar
Dean C Dean C is offline
 
Join Date: Jan 2002
Location: England
Posts: 9,071
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Wow sounds nice for big boards. I'll put a few of my friends in touch about this

- miSt
Reply With Quote
  #4  
Old 02-12-2003, 04:26 PM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

hmm, in don't like pruning old msgs....

ok, move em into an archive is ok
but good hack if you have to prune
Reply With Quote
  #5  
Old 02-12-2003, 05:42 PM
Dean C's Avatar
Dean C Dean C is offline
 
Join Date: Jan 2002
Location: England
Posts: 9,071
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Xenon - compressing threads is good but a friend of mine has a board with over 60,000 posts. He has to prune each week and even compressed this is not enough

I pointed this to him today so perhaps he'll try it out

- miSt
Reply With Quote
  #6  
Old 02-12-2003, 10:07 PM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

well i know some boards with over a million posts, what should they say? ^^
Reply With Quote
  #7  
Old 02-13-2003, 03:20 PM
Dean C's Avatar
Dean C Dean C is offline
 
Join Date: Jan 2002
Location: England
Posts: 9,071
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Sorry i meant 60,000 members. I'd hate to think how many posts they have
Reply With Quote
  #8  
Old 02-23-2003, 06:51 AM
rsuplido rsuplido is offline
 
Join Date: May 2002
Posts: 114
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks Jenn. This will be good for our Off-Topic forum.
Reply With Quote
  #9  
Old 04-04-2003, 01:53 AM
jamoss's Avatar
jamoss jamoss is offline
 
Join Date: Apr 2002
Location: Los Angeles
Posts: 81
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

In the attached zip file is an update to CRON_PRUNE.php and the instructions on how to install.

- allows multiple forum pruning with each having its own 'prune all messages older than X days' threshold.

- bypasses login screen in global.php
Reply With Quote
  #10  
Old 04-09-2003, 06:11 PM
ryancooper ryancooper is offline
 
Join Date: Jul 2002
Posts: 433
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

BEAUTIFULL Just what I need!!! Is there a way to test to see if the cronjob is set up properly?

BTY great site. My wife will love it, she just came home with 2 baby name books!!
Reply With Quote
Reply

Thread Tools

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 07:38 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.06466 seconds
  • Memory Usage 2,279KB
  • 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)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