Back up to Dropbox using ZIP instead of TGZ via PHP
<p>I found this PHP code. It backs up files and databased from your website to dropbox.</p>

<pre><code>&lt;?php

// Set the timezone so filenames are correct
date_default_timezone_set('Europe/London');

// Dropbox username/password
$dropbox_email='dropbox@dropbox.com';
$dropbox_pass='password';

// MySQL username/password/db name
$mysql_database='mysql_database';
$mysql_username='mysql_username';
$mysql_password='password';

// Filenames for backup files
$backup_dbname = "database_" . date("Y.m.d-H.i.s_l") . '.sql.gz';
$backup_files = "files_" . date("Y.m.d-h.i.s_l") . '.tgz';

// File to backup
$siteroot = "/site/home/public_html/";

// Backup database, obviously you can tweak the mysqldump switches
// Backup is GZipped.
system("mysqldump -h localhost -u $mysql_username --password=$mysql_password $mysql_database --complete-insert | gzip &gt; $backup_dbname");

// Backup all files in public_html apart from the gz
system("tar -czvf $backup_files $siteroot");

include("DropboxUploader.php");

$uploader = new DropboxUploader($dropbox_email, $dropbox_pass);
$uploader-&gt;upload($backup_files,'Backup/Files/');
$uploader-&gt;upload($backup_dbname,'Backup/Database/');

system("rm $backup_files");
system("rm $backup_dbname");

?&gt;
</code></pre>

<p>I want to back up the files $backup_files = "files_" . date("Y.m.d-h.i.s_l") . '.tgz'; to zip not tgz. When I repaced 'tgz' with 'zip' the zip file didn't open. I also tried to add '$createZip = new createZip;' but it didn't create the zip file at all. </p>

<p>I prefer zip instead of tgz for my situation please.</p>
