The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Turn off Forum via Shell Command Line?
I currently have a decently large forum with 56,000+ members and 2.1 million posts. This is on dedicated server and I back it up using mysqldump via SSH command line. I want to automate this process via a cron job.
Currently, I turn off the forums in the admin CP, do the mysqldump in shell then turn it back on. Obviously, the mysqldump is easily scripted but I need a way to turn off the forums with a script, like a ssh command or something. Any suggestions, ideas? If I dont turn the forums off, the update takes twice as long, the forums lag out and my members just sit there hitting refresh |
#2
|
|||
|
|||
You will need to run 2 queries:
To turn your forums off UPDATE datastore SET data=REPLACE(data,'s:8:"bbactive";i:1;','s:8:"bbac tive";i:0;') WHERE title='options'; UPDATE setting SET value=0 WHERE varname='bbactive'; To turn your forums on UPDATE datastore SET data=REPLACE(data,'s:8:"bbactive";i:0;','s:8:"bbac tive";i:1;') WHERE title='options'; UPDATE setting SET value=1 WHERE varname='bbactive'; |
#3
|
|||
|
|||
Note that the queries above will not work when one of the datastore caching modules (XCache, APC, eAccelerator, memcached) is enabled. The script must be more sophisticated - it should be able to flush memory cache for the appropriate datastore caching module.
|
#4
|
||||
|
||||
Here is a more sophisticated script:
PHP Code:
(Adding yet-another bug report now ...) Also setting the board offline does not completely kill queries so you might still run into table locking issues. |
#5
|
|||
|
|||
Sorry its taken me so long to get back to you. But thanks alot all. I appreciate it. Hopefully thread will help others as well.
|
#6
|
|||
|
|||
-bump-
Sorry to bump such an old thread, but I was wondering how one could manipulate this to do the reverse - turn the forum back ON via a script. |
#7
|
|||
|
|||
Quote:
If calling from a shell (ie straight on the server using command line) you would call it like this: > vbscript.php (will close the site) > vbscript.php 1 (will open the site) > vbscript.php 0 (will also close site) I believe you can also use these through a direct call to the file from a web browser. I'm not sure the exact formatting, but it would be similar to "yourservername.com/vbscript.php?1" Hope that helps. Also from a security standpoint I wound't suggest allowing something like this to be call from a web browser and only use it on the command line. I'm integrating this into a script I use to backup my site, but we are so large I need to have the site offline in order to make the 18GB backup. PHP Page for reference on usage: http://www.php.net/manual/en/reserve...les.server.php argv specific section: Quote:
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|