$db_name = EZSQL_DB_NAME;
//---- Your database name.
$db_user = EZSQL_DB_USER;
//---- Your database username.
$db_pass = EZSQL_DB_PASSWORD;
//---- Your database password.
$dowhat = "backup";
//$dowhat = "restore";
if ($dowhat == "backup") {
    // This code doesn't export dates
    //$structure_only = false;
    //$output = "./backup/backup_data.txt";
    //$backup = new mysql_backup($db_host,$db_name,$db_user,$db_pass,$output,$structure_only);
    //$backup->backup();
    require_once "../libs/backup/mysql_backup/init.php";
    $b = new backup();
    $b->dbconnect($GonxAdmin["dbhost"], $GonxAdmin["dbuser"], $GonxAdmin["dbpass"], $GonxAdmin["dbname"], "", $GonxAdmin["dbtype"]);
    $b->generate();
    $structure_only = true;
    $output = "./backup/MySQL-Structure-Backup-" . $b->filename;
    $backup = new mysql_backup($db_host, $db_name, $db_user, $db_pass, $output, $structure_only);
    $backup->backup();
}
if ($dowhat == "restore") {
    $output = "./backup/backup_structure.txt";
    $backup = new mysql_backup($db_host, $db_name, $db_user, $db_pass, $output, $structure_only);
    $backup->restore(";");
    $output = "./backup/backup_data.txt";
    $backup = new mysql_backup($db_host, $db_name, $db_user, $db_pass, $output, $structure_only);
    $backup->restore(");");
}
Exemple #2
0
 case "create":
     $page = "<li><a href=\"?go=generate\" class=tab-s>" . $GONX["backupholedb"] . " <b>" . $GonxAdmin["dbname"] . "</b></a></li><br><br>\n\t\t<HR align=left width=\"100%\" color=#aaaaaa noShade SIZE=1>\n\t\t<li><span class=tab-s>" . $GONX["selecttables"] . "</span></li>";
     $b = new backup();
     $b->dbconnect($GonxAdmin["dbhost"], $GonxAdmin["dbuser"], $GonxAdmin["dbpass"], $GonxAdmin["dbname"]);
     $page .= $b->tables_menu();
     break;
 case "backuptables":
     $b = new backup();
     $b->dbconnect($GonxAdmin["dbhost"], $GonxAdmin["dbuser"], $GonxAdmin["dbpass"], $GonxAdmin["dbname"]);
     $page = $b->tables_backup($tables, $structonly);
     $page = $page . $b->listbackups();
     break;
 case "generate":
     $b = new backup();
     $b->dbconnect($GonxAdmin["dbhost"], $GonxAdmin["dbuser"], $GonxAdmin["dbpass"], $GonxAdmin["dbname"]);
     $page = $b->generate();
     $page = $page . $b->listbackups();
     break;
 case "list":
     $b = new backup();
     $page = $b->listbackups();
     break;
 case "delete":
     $b = new backup();
     $page = $b->delete($fname);
     $page = $page . $b->listbackups();
     break;
 case "import":
     $b = new backup();
     $b->dbconnect($GonxAdmin["dbhost"], $GonxAdmin["dbuser"], $GonxAdmin["dbpass"], $GonxAdmin["dbname"]);
     $page = $b->import($bfile);