PDA

View Full Version : Cron backup of vbulletin 3.7.x


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 :)

Marco van Herwaarden
07-31-2008, 08:20 AM
Option 1.

Markowitch
07-31-2008, 10:47 AM
Yes - Option 1 is working smoothly :)

I was wondering though if some of the other options were more in tune with "the spirit" of vbulletin though...

Marco van Herwaarden
07-31-2008, 12:03 PM
Option 2 would be the most "correct" way to do this, but overkill for what you need and the result is the same.

Option 3 is the same as option 2, but then packaged in a "nicer" interface to use in scripts.

Markowitch
01-03-2010, 03:18 PM
Deleted post.