1234567891011121314151617181920 |
- <?php
- chdir(dirname(__FILE__));
- require_once 'config.php';
- require_once 'function.php';
- $mysqldump = 'mysqldump';
- $opt = ' --no-defaults --add-drop-table ';
- // $opt .= ' --compatible=no_table_options,mysql323 ';
- //$opt .= ' --compact ';
- $optAuth = ' -h '.$adodb_host.' -u '.$adodb_user.' --password='.$adodb_pass.' '.$adodb_db;
- $outFile = dirname(__FILE__).DIRECTORY_SEPARATOR.'backup'.DIRECTORY_SEPARATOR.$adodb_db.'_'.date('Y-m-d').'.sql';
- $outFile = escapeshellarg($outFile);
- openLogger(basename(__FILE__));
- $logger->info($mysqldump.$opt.$optAuth.' > '.$outFile);
- $output = shell_exec($mysqldump.$opt.$optAuth.' > '.$outFile);
- //if ($output) $logger->info($output);
- closeLogger();
- ?>
|