<?php
// dump mysql file
$myUser = 'root';
$myPass = 'root';
$myHost = 'localhost';
$myDbs = array('db1', 'db2');
$destDir = './backup/';
$date = date('Ymd');
$files = array();
foreach ($myDbs as $v) {
$file = $destDir.$v.'-'.$date.'.sql.gz';
$files[] = $file;
exec("/usr/bin/mysqldump -u $myUser -h $myHost -p$myPass --opt $v | /bin/gzip -9 > $file");
}
?>
// dump mysql file
$myUser = 'root';
$myPass = 'root';
$myHost = 'localhost';
$myDbs = array('db1', 'db2');
$destDir = './backup/';
$date = date('Ymd');
$files = array();
foreach ($myDbs as $v) {
$file = $destDir.$v.'-'.$date.'.sql.gz';
$files[] = $file;
exec("/usr/bin/mysqldump -u $myUser -h $myHost -p$myPass --opt $v | /bin/gzip -9 > $file");
}
?>
0 comments:
Post a Comment