Darth Wong wrote: It should only affect people who are trying to post while you're backing up.
Code: Select all
#!/usr/bin/perl
use DBI;
use strict;
# set up path options
my($phpBBroot) = '/home/server/www/forum_path';
# db access variables
my $dbhq;
my($dbms, $dbhost, $dbname, $dbuser, $dbpasswd) = ('','','','','');
my($inputline) = '';
# read config file
open (CONFIG, "<$phpBBroot/config.php");
while (<CONFIG>)
{
$inputline = $_;
eval($inputline) if (substr($inputline,0,3) eq '$db');
}
close (CONFIG);
# set up database interface handle
$dbhq = DBI->connect("dbi:$dbms:database=$dbname;host=$dbhost","$dbuser","$dbpasswd");
# cursor to get current status
my($c_get_status) = $dbhq->prepare('
SELECT config_value
FROM phpbb_config
WHERE config_name = "board_disable"
');
# cursor to update board config
my($c_update_status) = $dbhq->prepare('
UPDATE phpbb_config
SET config_value = ?
WHERE config_name = "board_disable"
');
$c_get_status->execute();
my($board_status) = $c_get_status->fetchrow();
$board_status = ($board_status == 1) ? 0 : 1;
$c_update_status->execute($board_status);
$c_get_status->finish();
$dbhq->disconnect;
print ("board status is now $board_status\n");
drathbun wrote: But SSH doesn't give you a backup program. It just gives you access to the command line. From there you would use something like mysqldump, which is what we were talking about earlier.
Same thing for telnet. The difference (I've been told) between ssh and telnet is that telnet sends your password as clear text to the server, while ssh does not.
Telnet is generally port 23, and ssh on port 22.
Dave