Announcement

Collapse
No announcement yet.

How can I close the forum by cron job?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • How can I close the forum by cron job?

    Hi all,

    One of the forums I'm running has been affected several times by hackers and from now on I want to keep a good backup of everything. Because vBulletin's cron jobs scheduler is not reliable to do this by it's own (according to experienced users here in this forum) I want to use my server's cron jobs to do the backups but I need to close the forum before it starts.

    How can I do this? For example, I want vBulletin to close the forum for maintenance every monday at 2:00 am and re-open it at 5:00 am so I can cron-backup the site beggining at 2:10 am the same day (it shouldn't take more than 2 hours to do it in my case).

    Thanks in advance,
    Cesar Aracena

  • #2
    you can do it by running a mysql command that will set the value of bbactive (in the setting table) to on
    if you are familar with mysql, you will understand that it qould be something similar to this (the following command is not tested, to be sure you test i in your local server first)

    Code:
     UPDATE setting SET value = 0 WHERE varname = 'bbactive'
    remember to set it back to 0 after you finish backing up.

    but I backup daily without closing the forum.
    while(true){
    if(
    $someone->needsHelp() && $i->canHelp()) $post->help();
    if(
    $i->findBug()) $post->bug();
    }

    Comment


    • #3
      Thanks... I didn't think on using the cron job to interact with the DB before but it doesn't sound bad... gonna try it.

      I would recommend you start closing it before you do any backup... that's what's recommended and I guess it could be dangerous not to do so when you have let's say... 100 users or more in your forum. One PM or post made at the right time can mess up your backup to start with (that's only if your backup method don't take possession over your DB server and close it for other transactions).
      Cesar Aracena

      Comment


      • #4
        that's what's recommended
        Who recommended it? There's no such thing as a a "post made at the right time can mess up your backup". No posts will be made during the backup as the tables will be locked as they are being dumped. The worst thing that can happen is somebody will *try* to submit a post while the table is locked, and the forum will hang until the lock is released. Then the post will go through.

        Unless you have a HUGE database that takes several minutes to dump, there's absolutely no need to close the forum during backups. Even then, the only thing that can happen is the board will appear unresponsive for several minutes with no explanation.
        Anybody who says "it can't be done" will usually be interrupted by somebody who is already doing it.

        Comment


        • #5
          I have around 100k users, more than 1,5 mio posts and around the 1k users online at once, and I don't close the forum while doing a database backup and it works perfectly. think of it that when you close your forums everyday you close the access for the web crawlers which is a bad thing. I recommend you to no close your orum while the database backup.
          Last edited by Dody; Fri 14 Aug '09, 11:36am.
          while(true){
          if(
          $someone->needsHelp() && $i->canHelp()) $post->help();
          if(
          $i->findBug()) $post->bug();
          }

          Comment


          • #6
            May want to read through this thread.
            http://www.vbulletin.com/forum/showthread.php?p=1772501
            ...steven
            www.318ti.org (vB3.8) | www.nccbmwcca.org (vB4.2)
            bmwcca.org/forum | m135i.net
            "I tried to clean this up but this thread is beyond redemption." - Steve Machol

            Comment

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