Markowitch
07-31-2008, 07:56 AM
Hi!
I'm using mysqldump to dump my database to a file which is later zipped. I'm doing this through Python and has set up a cron job using crontab. It works fine and produce the regular backups I need. However, one issue remains!!
When performing the backup I would REALLY love to shut down the forum by programatically activating or deactivating the forum. Just like it's done in the AdminCP.
I have a thread on vbulletin.com that describes what I have tried to achieve this:
http://www.vbulletin.com/forum/showthread.php?p=1602252
So It seems like I have a couple of options.
Number 1:
(thanx to Andy Huang at vbulletin.com)
Turn off:
UPDATE datastore SET data=REPLACE(data,'s:8:"bbactive";i:1;','s:8:"bbactive";i:0;') WHERE title='options';
UPDATE setting SET value=0 WHERE varname='bbactive';
Turn on:
UPDATE datastore SET data=REPLACE(data,'s:8:"bbactive";i:0;','s:8:"bbactive";i:1;') WHERE title='options';
UPDATE setting SET value=1 WHERE varname='bbactive';
Number 2:
(thanx to Sockwater at vbulletin.com)
Run the update query on the setting table, then call build_datastore() with the appropriate parameters.
Number 3:
Build a datamanager that can take care of turning the board on and off.
Question:
How would you guys go about and solve this task? Option 1: is easy and the properly also the way I'm going to do this to begin with. However, the build_datastore() is interesting but I have no clue on how to use it to turn the board on and off.
The last option with the datamanager is also one of the points where I'm clueless.
Hope that some of you can help me in the right direction - thanx :)
I'm using mysqldump to dump my database to a file which is later zipped. I'm doing this through Python and has set up a cron job using crontab. It works fine and produce the regular backups I need. However, one issue remains!!
When performing the backup I would REALLY love to shut down the forum by programatically activating or deactivating the forum. Just like it's done in the AdminCP.
I have a thread on vbulletin.com that describes what I have tried to achieve this:
http://www.vbulletin.com/forum/showthread.php?p=1602252
So It seems like I have a couple of options.
Number 1:
(thanx to Andy Huang at vbulletin.com)
Turn off:
UPDATE datastore SET data=REPLACE(data,'s:8:"bbactive";i:1;','s:8:"bbactive";i:0;') WHERE title='options';
UPDATE setting SET value=0 WHERE varname='bbactive';
Turn on:
UPDATE datastore SET data=REPLACE(data,'s:8:"bbactive";i:0;','s:8:"bbactive";i:1;') WHERE title='options';
UPDATE setting SET value=1 WHERE varname='bbactive';
Number 2:
(thanx to Sockwater at vbulletin.com)
Run the update query on the setting table, then call build_datastore() with the appropriate parameters.
Number 3:
Build a datamanager that can take care of turning the board on and off.
Question:
How would you guys go about and solve this task? Option 1: is easy and the properly also the way I'm going to do this to begin with. However, the build_datastore() is interesting but I have no clue on how to use it to turn the board on and off.
The last option with the datamanager is also one of the points where I'm clueless.
Hope that some of you can help me in the right direction - thanx :)