This is how I do a backup of a mysql database with php:
$backupFile = '/home/owner/dbbackup/'.$dbname .'-' .$filename.
'.sql';
$command = "mysqldump --opt -h $dbhost -u $dbuser -p$dbpass $dbname>
$backupFile";
$dummy = system($command , $retval);
It works OK and creates a .sql file, but how do I compress the file to
a gzip file?
Kind regards,
Jan Nordgreen
$backupFile = '/home/owner/dbbackup/'.$dbname .'-' .$filename.
'.sql';
$command = "mysqldump --opt -h $dbhost -u $dbuser -p$dbpass $dbname>
$backupFile";
$dummy = system($command , $retval);
It works OK and creates a .sql file, but how do I compress the file to
a gzip file?
Kind regards,
Jan Nordgreen
Comment