Skip to content

Commit 600d2c3

Browse files
author
Jorge Muñoz
committed
Fix check of borg utility not performed on slave server
1 parent b43ddc8 commit 600d2c3

File tree

2 files changed

+19
-5
lines changed

2 files changed

+19
-5
lines changed

interface/web/admin/server_config_edit.php

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,20 @@ function onShow() {
6464
unset($app->tform->formDef["tabs"]["vlogger"]);
6565
}
6666
//Check if borg is installed
67-
if (!$app->system->is_installed('borg')) {
67+
$is_borg_installed = false;
68+
if($this->id != $conf['server_id']) {
69+
$mon = $app->db->queryOneRecord('SELECT `data` FROM `monitor_data` WHERE `server_id` = ? AND `type` = ? ORDER BY `created` DESC', $this->id, 'backup_utils');
70+
if($mon) {
71+
$missing_utils = unserialize($mon['data']);
72+
if($missing_utils) {
73+
$missing_utils = $missing_utils['missing_utils'];
74+
$is_borg_installed = ! in_array('borg', $missing_utils);
75+
}
76+
}
77+
} else {
78+
$is_borg_installed = $app->system->is_installed('borg');
79+
}
80+
if ( ! $is_borg_installed) {
6881
$app->tpl->setVar('missing_utils', 'BorgBackup');
6982
}
7083
parent::onShow();

server/lib/classes/cron.d/100-monitor_backup.inc.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@ public function onRunJob() {
6363
$type = 'backup_utils';
6464

6565
$missing_utils = array();
66-
$compressors_list = array(
66+
$util_list = array(
67+
'borg',
6768
'gzip',
6869
'gunzip',
6970
'zip',
@@ -77,9 +78,9 @@ public function onRunJob() {
7778
'7z',
7879
'rar',
7980
);
80-
foreach ($compressors_list as $compressor) {
81-
if (!$app->system->is_installed($compressor)) {
82-
$missing_utils[] = $compressor;
81+
foreach ($util_list as $util) {
82+
if (!$app->system->is_installed($util)) {
83+
$missing_utils[] = $util;
8384
}
8485
}
8586

0 commit comments

Comments
 (0)