Skip to content

Commit 061d7c8

Browse files
author
Till Brehm
committed
Removed backup_dir_mount_cmd option from Sysstem > server config. The option has been replaced by a script /usr/local/ispconfig/server/scripts/backup_dir_mount.sh. If this script exists, is exacutable and is owned by the root user, then it will be executed upfront of the backup jobs when the option "Backup directory is a mount?" is enabled in server config settings.
1 parent 0b77531 commit 061d7c8

File tree

5 files changed

+7
-17
lines changed

5 files changed

+7
-17
lines changed

install/tpl/server.ini.master

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ loglevel=2
1616
admin_notify_events=1
1717
backup_dir=/var/backup
1818
backup_dir_is_mount=n
19-
backup_dir_mount_cmd=
2019
backup_mode=rootgz
2120
monit_url=
2221
monit_user=

interface/web/admin/form/server_config.tform.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -177,14 +177,6 @@
177177
'default' => 'n',
178178
'value' => array(0 => 'n', 1 => 'y')
179179
),
180-
'backup_dir_mount_cmd' => array(
181-
'datatype' => 'VARCHAR',
182-
'formtype' => 'TEXT',
183-
'default' => '',
184-
'value' => '',
185-
'width' => '40',
186-
'maxlength' => '255'
187-
),
188180
'backup_mode' => array(
189181
'datatype' => 'VARCHAR',
190182
'formtype' => 'SELECT',

interface/web/admin/lib/lang/en_server_config.lng

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,5 @@ $wb['munin_password_txt'] = 'Munin Password';
189189
$wb['munin_url_error_regex'] = 'Invalid Munin URL';
190190
$wb['munin_url_note_txt'] = 'Placeholder:';
191191
$wb['backup_dir_is_mount_txt'] = 'Backup directory is a mount?';
192-
$wb['backup_dir_mount_cmd_txt'] = 'Mount command, if backup directory not mounted';
193192
$wb['monitor_system_updates_txt'] = 'Check for Linux updates';
194193
?>

interface/web/admin/templates/server_config_server_edit.htm

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,6 @@ <h2><tmpl_var name="list_head_txt"></h2>
6464
<div class="multiField">
6565
{tmpl_var name='backup_dir_is_mount'}
6666
</div>
67-
</div>
68-
<div class="ctrlHolder">
69-
<label for="backup_dir_mount_cmd">{tmpl_var name='backup_dir_mount_cmd_txt'}</label>
70-
<input name="backup_dir_mount_cmd" id="backup_dir_mount_cmd" value="{tmpl_var name='backup_dir_mount_cmd'}" size="40" maxlength="255" type="text" class="textInput" />
7167
</div>
7268
<div class="ctrlHolder">
7369
<label for="backup_mode">{tmpl_var name='backup_mode_txt'}</label>

server/cron_daily.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1104,10 +1104,14 @@ function send_notification_email($template, $placeholders, $recipients) {
11041104

11051105
//* mount backup directory, if necessary
11061106
$run_backups = true;
1107-
$server_config['backup_dir_mount_cmd'] = trim($server_config['backup_dir_mount_cmd']);
1108-
if($server_config['backup_dir_is_mount'] == 'y' && $server_config['backup_dir_mount_cmd'] != ''){
1107+
$backup_dir_mount_cmd = '/usr/local/ispconfig/server/scripts/backup_dir_mount.sh';
1108+
if( $server_config['backup_dir_is_mount'] == 'y' &&
1109+
is_file($backup_dir_mount_cmd) &&
1110+
is_executable($backup_dir_mount_cmd) &&
1111+
fileowner($backup_dir_mount_cmd) === 0
1112+
){
11091113
if(!$app->system->is_mounted($backup_dir)){
1110-
exec(escapeshellcmd($server_config['backup_dir_mount_cmd']));
1114+
exec($backup_dir_mount_cmd);
11111115
sleep(1);
11121116
if(!$app->system->is_mounted($backup_dir)) $run_backups = false;
11131117
}

0 commit comments

Comments
 (0)