vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   vb3 - prune forums/rebuild search index with cron job? (https://vborg.vbsupport.ru/showthread.php?t=61688)

allan grossman 02-18-2004 08:43 AM

vb3 - prune forums/rebuild search index with cron job?
 
Folks -

Is it possible to prune forums and empty and rebuild the search index as a cron job? If so, how?

I've got a couple of kinda high-traffic Usenet forums I'd like to keep under control.

thanks!

AN-net 02-18-2004 10:49 AM

im not sure but i think you could set up when it prunes

Dean C 02-18-2004 12:09 PM

It's perfectly possible - but I wouldn't reccomend it as rebuilding the search index takes a long time on big boards and even small boards. Hence if you have a user post in the middle of it's going to take a long while. You could however write a script to turn the board off, do your stuff and then turn it back on :)

allan grossman 02-18-2004 03:33 PM

Thanks, Dean -

Anybody have an idea how to prune forums as a real (non-vb) cron job?

Andreas 02-18-2004 03:42 PM

Code:

lock tables post, thread, forum write;
delete from post, thread where post.threadid=thread.threadid and thread.forumid=1234 and dateline < unix_timestamp(date_add(now(), interval -1 month));
delete from thread,forumid where thread.forumid=1234 and dateline < unix_timestamp(date_add(now(), interval -1 month));
unlock tables;

This should prune all posts & threads from forum 1234 that are older then 1 month.

allan grossman 02-18-2004 06:48 PM

Thanks, Kirby -

I was thinking more along the lines of which switches to add to thread.php so I could run it as a standalone or through lynx - because I'm looking to maintain threads where the last post is <90 days old in a single forum and then recurse into its child forums.

I'm pretty sure thread.php?do=prune will do what I need but I haven't figured out exactly how to spell it out on a command line.

I appreciate you taking the time with the sql query, though - thank you.


All times are GMT. The time now is 08:45 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.01786 seconds
  • Memory Usage 1,715KB
  • 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
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete