Link to home
Start Free TrialLog in
Avatar of delphibeginner
delphibeginnerFlag for Netherlands

asked on

Mysql dump without zip

I have this code from phpMySQLAutoBackup, its working, but I want the dump without the gz (zip).

Someone any idea how to do that?

Thanks

Here is the code I use: (part of the code, but the most important).
// zip the backup and email it
$backup_file_name = 'mysql_'.$db.strftime("_%d_%b_%Y_time_%H_%M_%S.sql",time()).'.gz';
$dump_buffer_not_zipped = $dump_buffer;
$dump_buffer = gzencode($buffer);
if ($from_emailaddress>"") xmail($to_emailaddress,$from_emailaddress, "phpMySQLAutoBackup: $backup_file_name", $dump_buffer, $backup_file_name, $backup_type, $newline);
if ($save_backup_zip_file_to_server) write_backup($dump_buffer_not_zipped, $backup_file_name);
 
//FTP backup file to remote server
if (isset($ftp_username))
{
 //write the backup file to local server ready for transfer if not already done so
 if (!$save_backup_zip_file_to_server) write_backup($dump_buffer, $backup_file_name);
 $transfer_backup = new transfer_backup();
 $transfer_backup->transfer_data($ftp_username,$ftp_password,$ftp_server,$ftp_path,$backup_file_name);
 if (!$save_backup_zip_file_to_server) unlink(LOCATION."../backups/".$backup_file_name);
}
?>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of flob9
flob9
Flag of France image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
sorry double sql extension line 4 :

$backup_file_name_not_zipped = 'mysql_'.$db.strftime("_%d_%b_%Y_time_%H_%M_%S.sql",time());
Avatar of delphibeginner

ASKER

Thanks for the reply.

The problem now is that the size is 0.

When it's being zipped its a couple of kb's.

Why?
Found it.

The line:
$dump_buffer_not_zipped = $dump_buffer;

Needed to be:
$dump_buffer_not_zipped = $buffer;

Because $buffer is used in an other file, my bad didn't said that.
Oh, sorry.
Many thanks
Dont worry, I'll reward you the points