Automatic forum on/off during backup !

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • hn74
    New Member
    • Jul 2008
    • 16
    • 3.7.x

    Automatic forum on/off during backup !

    Hi all ..

    i have just sat a cronjob for an auto backup
    and was wondering if there Is a way to
    turn a forum OFF and then ON automatically
    during the backup?


  • CarterMarkham
    Senior Member
    • Apr 2008
    • 207
    • 4.0.0

    #2
    Why would you need to turn it off??

    Comment

    • PSS
      Senior Member
      • Aug 2005
      • 115

      #3
      Originally posted by hn74
      Hi all ..

      i have just sat a cronjob for an auto backup
      and was wondering if there Is a way to
      turn a forum OFF and then ON automatically
      during the backup?


      You need to run a script (usually php or perl) which runs couple of sql commands.

      Turn forum off:

      Code:
      UPDATE s2v3i1_datastore SET data=REPLACE(data,'s:8:"bbactive";i:1;','s:8:"bbactive";i:0;') WHERE title='options';
      UPDATE s2v3i1_setting SET value=0 WHERE varname='bbactive';


      Turn forum on:


      Code:
      UPDATE s2v3i1_datastore SET data=REPLACE(data,'s:8:"bbactive";i:0;','s:8:"bbactive";i:1;') WHERE title='options';
      UPDATE s2v3i1_setting SET value=1 WHERE varname='bbactive';
      For perl DBI coding see http://www.ucl.ac.uk/is/mysql/perl/

      Originally posted by CarterMarkham
      Why would you need to turn it off??
      Because locking all tables and eating all mysql resources will cause queuing of both sql and http processes which will kill site performance for several minutes. It's much better to close forum, backup (mysqlhotcopy) and open forum again.

      Comment

      • hn74
        New Member
        • Jul 2008
        • 16
        • 3.7.x

        #4
        That's really great ..

        but you know something .. i am really new to all of this ..

        can you just tell me where to put that script ?

        Comment

        widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
        Working...