vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Cron job: Prune forums (https://vborg.vbsupport.ru/showthread.php?t=48827)

jamoss 02-11-2003 10:00 PM

Cron job: Prune forums
 
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

PSI|Dr-X 02-12-2003 02:51 PM

I will try cuz i really need it :)

Dean C 02-12-2003 03:22 PM

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

- miSt

Xenon 02-12-2003 04:26 PM

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

ok, move em into an archive is ok :)
but good hack if you have to prune :)

Dean C 02-12-2003 05:42 PM

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 :D

- miSt

Xenon 02-12-2003 10:07 PM

well i know some boards with over a million posts, what should they say? ^^

Dean C 02-13-2003 03:20 PM

Sorry i meant 60,000 members. I'd hate to think how many posts they have ;)

rsuplido 02-23-2003 06:51 AM

Thanks Jenn. This will be good for our Off-Topic forum.

jamoss 04-04-2003 01:53 AM

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

ryancooper 04-09-2003 06:11 PM

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!!


All times are GMT. The time now is 11:16 AM.

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.01061 seconds
  • Memory Usage 1,728KB
  • 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)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)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