Fix metadata not always being created on backup.
This commit is contained in:
@@ -1999,14 +1999,6 @@ function run_workspace_backup($task, $args) {
|
|||||||
$row = $rs->getRow();
|
$row = $rs->getRow();
|
||||||
$mysqlVersion = $row[0];
|
$mysqlVersion = $row[0];
|
||||||
$aSerializeData['DATABASE'] = $mysqlVersion;
|
$aSerializeData['DATABASE'] = $mysqlVersion;
|
||||||
$fileMetadata = PATH_TRUNK . 'backups' . PATH_SEP . 'metadata.txt';
|
|
||||||
$sMetadata = file_put_contents($fileMetadata, serialize($aSerializeData));
|
|
||||||
|
|
||||||
G::LoadThirdParty('pear/Archive', 'Tar');
|
|
||||||
|
|
||||||
$tar = new Archive_Tar($fileTar);
|
|
||||||
if (!isset($gzipPath))
|
|
||||||
$tar->_compress = $compress;
|
|
||||||
|
|
||||||
//new db restore rotines, by Erik <erik@colosa.com> on May 17th, 2010
|
//new db restore rotines, by Erik <erik@colosa.com> on May 17th, 2010
|
||||||
//set the temporal directory for all tables into wf, rb, and rp databases
|
//set the temporal directory for all tables into wf, rb, and rp databases
|
||||||
@@ -2014,6 +2006,18 @@ function run_workspace_backup($task, $args) {
|
|||||||
//create the db maintenance temporal dir
|
//create the db maintenance temporal dir
|
||||||
G::mk_dir($tmpDir);
|
G::mk_dir($tmpDir);
|
||||||
|
|
||||||
|
$fileMetadata = $tmpDir . 'metadata.txt';
|
||||||
|
$sMetadata = file_put_contents($fileMetadata, serialize($aSerializeData));
|
||||||
|
if ($sMetadata === false) {
|
||||||
|
throw new Exception("Metadata file could not be written");
|
||||||
|
}
|
||||||
|
|
||||||
|
G::LoadThirdParty('pear/Archive', 'Tar');
|
||||||
|
|
||||||
|
$tar = new Archive_Tar($fileTar);
|
||||||
|
if (!isset($gzipPath))
|
||||||
|
$tar->_compress = $compress;
|
||||||
|
|
||||||
/*** WORKFLOW DATABASE BACKUP ***/
|
/*** WORKFLOW DATABASE BACKUP ***/
|
||||||
$dbSettings = getDataBaseConfiguration($configuration['datasources']['workflow']['connection']);
|
$dbSettings = getDataBaseConfiguration($configuration['datasources']['workflow']['connection']);
|
||||||
backupDB($dbOpt[0], $dbOpt[1], $dbOpt[2], $dbSettings['dbname'], $tmpDir);
|
backupDB($dbOpt[0], $dbOpt[1], $dbOpt[2], $dbSettings['dbname'], $tmpDir);
|
||||||
|
|||||||
Reference in New Issue
Block a user