diff --git a/gulliver/bin/tasks/pakeGulliver.php b/gulliver/bin/tasks/pakeGulliver.php index 9fad7970e..3b03aa639 100644 --- a/gulliver/bin/tasks/pakeGulliver.php +++ b/gulliver/bin/tasks/pakeGulliver.php @@ -1999,8 +1999,18 @@ function run_workspace_backup($task, $args) { $row = $rs->getRow(); $mysqlVersion = $row[0]; $aSerializeData['DATABASE'] = $mysqlVersion; - $fileMetadata = PATH_TRUNK . 'backups' . PATH_SEP . 'metadata.txt'; + + //new db restore rotines, by Erik on May 17th, 2010 + //set the temporal directory for all tables into wf, rb, and rp databases + $tmpDir = G::getSysTemDir() . PATH_SEP . 'pmDbBackup' . PATH_SEP; + //create the db maintenance temporal dir + 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'); @@ -2008,12 +2018,6 @@ function run_workspace_backup($task, $args) { if (!isset($gzipPath)) $tar->_compress = $compress; - //new db restore rotines, by Erik on May 17th, 2010 - //set the temporal directory for all tables into wf, rb, and rp databases - $tmpDir = G::getSysTemDir() . PATH_SEP . 'pmDbBackup' . PATH_SEP; - //create the db maintenance temporal dir - G::mk_dir($tmpDir); - /*** WORKFLOW DATABASE BACKUP ***/ $dbSettings = getDataBaseConfiguration($configuration['datasources']['workflow']['connection']); backupDB($dbOpt[0], $dbOpt[1], $dbOpt[2], $dbSettings['dbname'], $tmpDir);