Retrofit from trunk

N°1191 - Wrong file name for backup check. [from revision 5143]
N°1188 - Backup needs too much disk space [from revision 5144]
N°1190 - Better error reporting and disk cleanup. [from revision 5145]
License reformat. [from revision 5146]
N°1188 & N°1189 Too much disk space / memory used for backup / restore - completing the commit [r5144], because the PHP extension phar is no more required [from revision 5151]

SVN:2.4[5233]
This commit is contained in:
Eric Espié
2018-01-11 08:05:10 +00:00
parent b268df7bb4
commit 4c6e6ffc9c
7 changed files with 2493 additions and 251 deletions

View File

@@ -61,6 +61,7 @@ try
catch (Exception $e)
{
$oPage->p('Error: '.$e->getMessage());
IssueLog::Error($sOperation.' - '.$e->getMessage());
}
}
$oPage->output();
@@ -156,6 +157,7 @@ EOF
{
$oRestoreMutex->Unlock();
$oPage->p('Error: '.$e->getMessage());
IssueLog::Error($sOperation.' - '.$e->getMessage());
}
}
$oPage->output();
@@ -179,6 +181,6 @@ EOF
}
catch (Exception $e)
{
IssueLog::Error($e->getMessage());
IssueLog::Error($sOperation.' - '.$e->getMessage());
}

View File

@@ -211,7 +211,7 @@ catch(Exception $e)
exit;
}
$sZipArchiveFile = MakeArchiveFileName();
$sZipArchiveFile = MakeArchiveFileName().'.tar.gz';
echo date('Y-m-d H:i:s')." - Checking file: $sZipArchiveFile\n";
if (file_exists($sZipArchiveFile))
@@ -223,7 +223,7 @@ if (file_exists($sZipArchiveFile))
if ($iSize > $iMIN)
{
echo "Found the archive\n";
$sOldArchiveFile = MakeArchiveFileName(time() - 86400); // yesterday's archive
$sOldArchiveFile = MakeArchiveFileName(time() - 86400).'.tar.gz'; // yesterday's archive
if (file_exists($sOldArchiveFile))
{
if ($aOldStat = stat($sOldArchiveFile))

View File

@@ -131,7 +131,7 @@ class DBRestore extends DBBackup
$oArchive->extractFileTo($sDataDir, 'itop-dump.sql');
$sDataFile = $sDataDir.'/itop-dump.sql';
$this->LoadDatabase($sDataFile);
unlink($sDataFile);
SetupUtils::rrmdir($sDataDir);
// Update the code
//