![]() |
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 |
I will try cuz i really need it :)
|
Wow sounds nice for big boards. I'll put a few of my friends in touch about this :)
- miSt |
hmm, in don't like pruning old msgs....
ok, move em into an archive is ok :) but good hack if you have to prune :) |
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 |
well i know some boards with over a million posts, what should they say? ^^
|
Sorry i meant 60,000 members. I'd hate to think how many posts they have ;)
|
Thanks Jenn. This will be good for our Off-Topic forum.
|
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 |
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 | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|