* [task#116512] Add the option to determine that if do backup before restore.
This commit is contained in:
@@ -267,16 +267,19 @@ class system extends control
|
||||
session_write_close();
|
||||
set_time_limit(0);
|
||||
|
||||
$instance = $this->config->instance->zentaopaas;
|
||||
$backupResult = $this->cne->backup($instance, 'SYSTEM', 'restore');
|
||||
if($backupResult->code != 200) $this->sendError($backupResult->message);
|
||||
|
||||
while(true)
|
||||
if(empty($this->config->system->noBackupBeforeRestore))
|
||||
{
|
||||
$backupStatus = $this->cne->getBackupStatus($instance, $backupResult->data->backup_name);
|
||||
if($backupStatus->code != 200) $this->sendError($backupStatus->message);
|
||||
if(strtolower($backupStatus->data->status) == 'completed') break;
|
||||
sleep(1);
|
||||
$instance = $this->config->instance->zentaopaas;
|
||||
$backupResult = $this->cne->backup($instance, 'SYSTEM', 'restore');
|
||||
if($backupResult->code != 200) $this->sendError($backupResult->message);
|
||||
|
||||
while(true)
|
||||
{
|
||||
$backupStatus = $this->cne->getBackupStatus($instance, $backupResult->data->backup_name);
|
||||
if($backupStatus->code != 200) $this->sendError($backupStatus->message);
|
||||
if(strtolower($backupStatus->data->status) == 'completed') break;
|
||||
sleep(1);
|
||||
}
|
||||
}
|
||||
|
||||
$backupName = str_replace('_', '-', $backupName);
|
||||
|
||||
Reference in New Issue
Block a user