Page 1 of 1

mysql backups

Posted: Wed Sep 02, 2009 11:12 am
by cardi777
hi all.

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 :P

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.'"');
 
any ideas!?

Cheers,
Doug

Re: mysql backups

Posted: Tue Sep 08, 2009 10:43 pm
by cardi777
found a great class, don't worry bout this