delete old dump before create

This commit is contained in:
rob committed 2020-03-28 17:43:15 +01:00
1 parent 87e5c48902
commit 8dd2418c80
1 file changed
+5 -1
@@ -40,8 +40,12 @@ while ($row = mysqli_fetch_array($result)) {
## Zip all dumps ## Zip all dumps
$zipfile = "dumps.zip"; $zipfile = "dumps.zip";
$zip = new ZipArchive;
if(file_exists($zipfile))
{
unlink($zipfile);
}
$zip = new ZipArchive;
if($zip -> open($zipfile, ZipArchive::CREATE ) === TRUE) if($zip -> open($zipfile, ZipArchive::CREATE ) === TRUE)
{ {
$dir = opendir($dumps_path); $dir = opendir($dumps_path);