Re: [Release] PunBB Backup v1.0
This is cool. Nice for users with less experience.
I agree with rickard, if you want to run a croned backup you would go better with the traditional dumps.
This is just a way to save a backup by clicking a few links in a simple and intuitive pannel. Love it. Just click>save and go!
anyway... i am running punbb with mysql, i use this the script i cron, it saves all databases with user read permition on the server.
<?php
$host = "localhost";
$user = "username";
$senha = "xpto";
$dbc = mysql_connect($host, $user, $senha);
$m = mysql_select_db("test", $dbc);
$sql = "SHOW DATABASES";
$sts = mysql_query($sql,$dbc) or die (mysql_error());
$data = date("YmdHis");
while($row = mysql_fetch_array($sts)){
$nome = $row[0];
$NARQUIVO = $nome."-".$data;
$resp = `mysqldump --host=$host --user=$user --password=$senha --databases $nome > $NARQUIVO.sql` ;
}
//set a name for the file
$arquivo = "mysql_".$data;
//create a .tar.gz file containing all the sql files
$resp = `tar -cvzf $arquivo.tar.gz *.sql`;
$resp = `rm *.sql`;
?>