I have this code but it doesn't something is wrong.
it makes the file, then downloads it, but it hasn't done much at all. No database in that gzip
Code: Select all
$backupFile = $dbname . date("Y-m-d-H-i-s") . '.gz';
$command = "mysqldump --opt -h $dbhost -u $dbuser -p $dbpass $dbname | gzip > ../db_backups/".$backupFile;
system($command);
header("Content-type: application/x-gzip");
header('Content-Disposition: attachment; filename="../db_backups/'.$backupFile.'"');
Cheers,
Doug