Page Index Toggle Pages: 1
Topic Tools
Normal Topic Putting forum into Maintenence Mode (Read 1,683 times)
Captain John
Ex Member


Re: Putting forum into Maintenence Mode
Reply #8 - Sep 11th, 2010 at 4:21pm
Post Tools
Now understood.
  
Back to top
 
IP Logged
 
The Boy
Full Member
***
Offline



Posts: 339
Location: UK
Re: Putting forum into Maintenence Mode
Reply #7 - Sep 11th, 2010 at 11:33am
Post Tools
To clarify, I was wanting Maintenence Mode, not to perform Maintenence (as in maintencne on the boards like what is available in Admin Panel), but to prevent members posting whilst I was manipulating/modifying YaBB datafiles/indexes for other purposes.
  
Back to top
WWW  
IP Logged
 
The Boy
Full Member
***
Offline



Posts: 339
Location: UK
Re: Putting forum into Maintenence Mode
Reply #6 - Sep 11th, 2010 at 11:30am
Post Tools
Not quite CJ - for rebuild/reindex etc (and most 'manual' tasks), I use the Admin panel as everyone else would.

There are some automated scripts I use that simply read YaBB's datafiles to create stats, reports, Google sitemaps etc from a Unix cron job, and written in a shell script (mostly).

Then, and this is the most dangerous, there are some scripts that modify YaBB's datafiles automatically, again run from Unix cron jobs, again in a bash or ksh script.  In this particular case that I wanted to put it into Maint Mode (due to the time it runs), it was to automatically lock threads based on certain calculations based on time of initial post. I modify the datafiles in the same way as YaBB's own scripts would (based on reverse engineering the datafiles before and after)


So, goes something like this
Check Maintmode setting in Settings.pl
Change Settings.pl to put into Maint Mode if reqd
Read a config file listing Boards I wish to run script on, and data used for calcs
Open Boards/boardname.txt
Read line in this index
If not already locked, obtain the Thread number for this thread
open Messages/threadno.txt
Get date/time of first post
do the logic to make the decision to autolock
If logic is true, add the Lock flag to thread line in Board index
Read next line in Boards/boardname.txt and repeat
Repeat for other boards that are configured for this
If forum was NOT in Maint mode before starting, remove it from Maint mode by modifying Settings.pl


In this case, I was considering stopping Apache, just in case there was that one in a million chance that an Admin (who can still post when in Maint Mode) posted on a thread which my script was updating the board index...  ...hmmm, maybe I should  Undecided




So, yes, I suspect I am 'on my own' shoud I have issues with index corruption in the Boards I am modifying outside of YaBB.
  
Back to top
WWW  
IP Logged
 
Captain John
Ex Member


Re: Putting forum into Maintenence Mode
Reply #5 - Sep 10th, 2010 at 9:23pm
Post Tools
The Boy wrote on Sep 10th, 2010 at 3:15pm:
replicate what YaBB's own scripts would do if I was manually clicking buttons within the browser - all the scripts I have written that modify YaBBs datafiles are all to automate tasks.

  Oh misunderstood ... your not modifying the YaBB scripts (pl files) and your not modifing the datafiles, your using your own scripts to rebuild, recount and backup (?).
  
Back to top
 
IP Logged
 
The Boy
Full Member
***
Offline



Posts: 339
Location: UK
Re: Putting forum into Maintenence Mode
Reply #4 - Sep 10th, 2010 at 3:15pm
Post Tools
Quote:
  Well your on your own, if your modifying the YaBB scripts.  Good Luck

Yup, fully understand that.

Any changes my own scripts make to YaBB datafiles, I try to simply replicate what YaBB's own scripts would do if I was manually clicking buttons within the browser - all the scripts I have written that modify YaBBs datafiles are all to automate tasks. These are the ones that concern me, as they pose the biggest risk if there is an unforeseen event.

I have plenty of other scripts that read and analyse YaBB's data files, but do not modify them, for example a google sitemap xml generator that submits a sitemap to google daily. I class these as 'safe'


I'm sure the community here will continue to assist me with any issues I hit that are not related to me corrupting my datafiles Smiley


As it happens, all corruption I have seen on my site so far always seems to be unrelated to anything I run, but more due to probably trying to run too big a forum on an underspec'd server  Embarrassed. Too many simultaneous searches is one thing that seems to cause us issues, but a quick (well, 40mins) rebuild board totals normally resolves these.  The other common 'corruption' one we always see (and seen on other YaBBs as well) is the 15th post in a thread not being visible. Add another post to thread, then immediately delete, and the 15th one shows again.



The great thing behind open source is the ability to go in, mess about, and modify to suit individual requirements. This is why I love YaBB.
  
Back to top
WWW  
IP Logged
 
Captain John
Ex Member


Re: Putting forum into Maintenence Mode
Reply #3 - Sep 9th, 2010 at 11:45pm
Post Tools
  Well your on your own, if your modifying the YaBB scripts.  Good Luck
  
Back to top
 
IP Logged
 
The Boy
Full Member
***
Offline



Posts: 339
Location: UK
Re: Putting forum into Maintenence Mode
Reply #2 - Sep 9th, 2010 at 8:17pm
Post Tools
Found what I was looking for - setting is in Settings.pl

Yes, I have scripts that automatically modify YaBB's files.  I necessity in my case I'm afraid.  Thats why, in the case of my script that automatically locks older threads in certain Boards, I wanted to pop YaBB into Maintenence Mode before locking all the older threads, to reduce chances of corruption, as it takes a few seconds to run...


I don't use YaBB's built in backup, as its not flexible enough for my needs. I have other backup scripts in place that automatically backup and offsite them every hour - used in anger as well Wink
  
Back to top
WWW  
IP Logged
 
Captain John
Ex Member


Re: Putting forum into Maintenence Mode
Reply #1 - Sep 9th, 2010 at 1:51am
Post Tools
The Boy wrote on Sep 8th, 2010 at 6:52pm:
esp those that modify YaBB files

  Absolutely No scripts should "modify" YaBB files.
The Boy wrote on Sep 8th, 2010 at 6:52pm:
Which file(s)/flag(s) dictate if we are in Maint mode - I'm looking at directly manipulating these files to put forum into Maint, let my script run, then return from Maint.

   When Maintenance functions run, "data" files are rebuilt.  Any functions that states "Rebuild" requires the forum to be in Maintenance Mode.
    You don't state what version of YaBB your forum is running.  Y2.5 Automatically places the forum in Maintenance Mode when rebuilding.  I believe Y2.4 does so too .. but not sure in what past version this was implemented.
   If your running Y2.4/Y2.5 Version of YaBB, I hope you are also using the Built in Backup system also and the reminder function.
« Last Edit: Sep 9th, 2010 at 1:51am by »  
Back to top
 
IP Logged
 
The Boy
Full Member
***
Offline



Posts: 339
Location: UK
Putting forum into Maintenence Mode
Sep 8th, 2010 at 6:52pm
Post Tools
As my forum grows, currently approaching 1,000,000 posts, some of my external scripts that run over my YaBB files are getting more prone to corrupting it, esp those that modify YaBB files.

Therefore, I need to be able to pop my forum into Maint, run the script, then back to normal.

Which file(s)/flag(s) dictate if we are in Maint mode - I'm looking at directly manipulating these files to put forum into Maint, let my script run, then return from Maint.
  
Back to top
WWW  
IP Logged
 
Page Index Toggle Pages: 1
Topic Tools
 
  « Board Index ‹ Board  ^Top