Fix for #2191 - n the packaged version, backups can neither be created nor restored.
This commit is contained in:
parent
6eb888ecdc
commit
bd3828c97c
|
@ -337,14 +337,15 @@ class Backup
|
||||||
*/
|
*/
|
||||||
private function doIt()
|
private function doIt()
|
||||||
{
|
{
|
||||||
|
global $CC_CONFIG;
|
||||||
if ($this->loglevel=='debug') {
|
if ($this->loglevel=='debug') {
|
||||||
$this->addLogItem("-I- ".date("Ymd-H:i:s")." doIt\n");
|
$this->addLogItem("-I- ".date("Ymd-H:i:s")." doIt\n");
|
||||||
}
|
}
|
||||||
$command = dirname(__FILE__).'/../bin/backup.sh'.
|
$command = $CC_CONFIG['storageBinDir']."/backup.sh"
|
||||||
" {$this->tmpDir}".
|
." {$this->tmpDir}"
|
||||||
" {$this->tmpFile}".
|
." {$this->tmpFile}"
|
||||||
" {$this->statusFile}".
|
." {$this->statusFile}"
|
||||||
" >> {$this->logFile} &";
|
." >> {$this->logFile} &";
|
||||||
$res = system("$command");
|
$res = system("$command");
|
||||||
sleep(2);
|
sleep(2);
|
||||||
if ($this->loglevel=='debug') {
|
if ($this->loglevel=='debug') {
|
||||||
|
|
|
@ -82,6 +82,7 @@ class Restore {
|
||||||
*/
|
*/
|
||||||
function openRestore($sessid, $backup_file)
|
function openRestore($sessid, $backup_file)
|
||||||
{
|
{
|
||||||
|
global $CC_CONFIG;
|
||||||
if ($this->loglevel=='debug') {
|
if ($this->loglevel=='debug') {
|
||||||
$this->addLogItem("-I-".date("Ymd-H:i:s")." doRestore - sessid:$sessid\n");
|
$this->addLogItem("-I-".date("Ymd-H:i:s")." doRestore - sessid:$sessid\n");
|
||||||
}
|
}
|
||||||
|
@ -95,7 +96,7 @@ class Restore {
|
||||||
file_put_contents($this->statusFile, 'working');
|
file_put_contents($this->statusFile, 'working');
|
||||||
|
|
||||||
//call the restore script in background
|
//call the restore script in background
|
||||||
$command = dirname(__FILE__).'/../bin/restore.php';
|
$command = $CC_CONFIG['storageBinDir'].'/restore.php';
|
||||||
$runLog = "/dev/null";
|
$runLog = "/dev/null";
|
||||||
$params = "{$backup_file} {$this->statusFile} {$this->token} {$sessid}>> $runLog &";
|
$params = "{$backup_file} {$this->statusFile} {$this->token} {$sessid}>> $runLog &";
|
||||||
$ret = system("$command $params", $st);
|
$ret = system("$command $params", $st);
|
||||||
|
@ -273,7 +274,7 @@ class Restore {
|
||||||
if ($this->loglevel=='debug') {
|
if ($this->loglevel=='debug') {
|
||||||
$this->addLogItem("-I- ".date("Ymd-H:i:s")." addFileToStorage - file:$file | type:$type | id:$gunid\n");
|
$this->addLogItem("-I- ".date("Ymd-H:i:s")." addFileToStorage - file:$file | type:$type | id:$gunid\n");
|
||||||
}
|
}
|
||||||
require_once "XmlParser.php";
|
require_once("XmlParser.php");
|
||||||
$tree = XmlParser::parse($file);
|
$tree = XmlParser::parse($file);
|
||||||
$mediaFileLP = str_replace('.xml','',$file);
|
$mediaFileLP = str_replace('.xml','',$file);
|
||||||
$mediaFileLP = ($type=='audioClip' && is_file($mediaFileLP))?$mediaFileLP:'';
|
$mediaFileLP = ($type=='audioClip' && is_file($mediaFileLP))?$mediaFileLP:'';
|
||||||
|
@ -304,7 +305,6 @@ class Restore {
|
||||||
} else {
|
} else {
|
||||||
// add as new
|
// add as new
|
||||||
$parid = $this->gb->_getHomeDirIdFromSess($this->sessid);
|
$parid = $this->gb->_getHomeDirIdFromSess($this->sessid);
|
||||||
#$this->addLogItem("Parid:$parid\n");
|
|
||||||
$name = $tree->children[0]->children[0]->content;
|
$name = $tree->children[0]->children[0]->content;
|
||||||
if (empty($name)) {
|
if (empty($name)) {
|
||||||
$name = $tree->attrs['title']->val;
|
$name = $tree->attrs['title']->val;
|
||||||
|
|
|
@ -58,6 +58,7 @@ $CC_CONFIG = array(
|
||||||
'accessDir' => dirname(__FILE__).'/../../storageServer/var/access',
|
'accessDir' => dirname(__FILE__).'/../../storageServer/var/access',
|
||||||
'pearPath' => dirname(__FILE__).'/../../../../usr/lib/pear',
|
'pearPath' => dirname(__FILE__).'/../../../../usr/lib/pear',
|
||||||
'cronDir' => dirname(__FILE__).'/../../storageServer/var/cron',
|
'cronDir' => dirname(__FILE__).'/../../storageServer/var/cron',
|
||||||
|
'storageBinDir' => dirname(__FILE__).'/../bin',
|
||||||
'isArchive' => FALSE,
|
'isArchive' => FALSE,
|
||||||
'validate' => TRUE,
|
'validate' => TRUE,
|
||||||
'useTrash' => TRUE,
|
'useTrash' => TRUE,
|
||||||
|
|
|
@ -53,12 +53,13 @@ $CC_CONFIG = array(
|
||||||
'StationPrefsGr'=> 'StationPrefs',
|
'StationPrefsGr'=> 'StationPrefs',
|
||||||
'AllGr' => 'All',
|
'AllGr' => 'All',
|
||||||
'TrashName' => 'trash_',
|
'TrashName' => 'trash_',
|
||||||
'storageDir' => dirname(__FILE__).'/../../storageServer/var/stor',
|
'storageDir' => dirname(__FILE__).'/../../storageServer/var/stor',
|
||||||
'bufferDir' => dirname(__FILE__).'/../../storageServer/var/stor/buffer',
|
'bufferDir' => dirname(__FILE__).'/../../storageServer/var/stor/buffer',
|
||||||
'transDir' => dirname(__FILE__).'/../../storageServer/var/trans',
|
'transDir' => dirname(__FILE__).'/../../storageServer/var/trans',
|
||||||
'accessDir' => dirname(__FILE__).'/../../storageServer/var/access',
|
'accessDir' => dirname(__FILE__).'/../../storageServer/var/access',
|
||||||
'pearPath' => 'ls_lib_dir/pear',
|
'pearPath' => 'ls_lib_dir/pear',
|
||||||
'cronDir' => dirname(__FILE__).'/../../storageServer/var/cron',
|
'cronDir' => dirname(__FILE__).'/../../storageServer/var/cron',
|
||||||
|
'storageBinDir' => dirname(__FILE__).'/../../../../bin',
|
||||||
'isArchive' => FALSE,
|
'isArchive' => FALSE,
|
||||||
'validate' => TRUE,
|
'validate' => TRUE,
|
||||||
'useTrash' => TRUE,
|
'useTrash' => TRUE,
|
||||||
|
|
Loading…
Reference in New Issue