Commit 061d7c84 authored by Till Brehm's avatar Till Brehm

Removed backup_dir_mount_cmd option from Sysstem > server config. The option...

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.
parent 0b77531b
......@@ -16,7 +16,6 @@ loglevel=2
admin_notify_events=1
backup_dir=/var/backup
backup_dir_is_mount=n
backup_dir_mount_cmd=
backup_mode=rootgz
monit_url=
monit_user=
......
......@@ -177,14 +177,6 @@ $form["tabs"]['server'] = array(
'default' => 'n',
'value' => array(0 => 'n', 1 => 'y')
),
'backup_dir_mount_cmd' => array(
'datatype' => 'VARCHAR',
'formtype' => 'TEXT',
'default' => '',
'value' => '',
'width' => '40',
'maxlength' => '255'
),
'backup_mode' => array(
'datatype' => 'VARCHAR',
'formtype' => 'SELECT',
......
......@@ -189,6 +189,5 @@ $wb['munin_password_txt'] = 'Munin Password';
$wb['munin_url_error_regex'] = 'Invalid Munin URL';
$wb['munin_url_note_txt'] = 'Placeholder:';
$wb['backup_dir_is_mount_txt'] = 'Backup directory is a mount?';
$wb['backup_dir_mount_cmd_txt'] = 'Mount command, if backup directory not mounted';
$wb['monitor_system_updates_txt'] = 'Check for Linux updates';
?>
......@@ -64,10 +64,6 @@
<div class="multiField">
{tmpl_var name='backup_dir_is_mount'}
</div>
</div>
<div class="ctrlHolder">
<label for="backup_dir_mount_cmd">{tmpl_var name='backup_dir_mount_cmd_txt'}</label>
<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" />
</div>
<div class="ctrlHolder">
<label for="backup_mode">{tmpl_var name='backup_mode_txt'}</label>
......
......@@ -1104,10 +1104,14 @@ if($backup_dir != '') {
//* mount backup directory, if necessary
$run_backups = true;
$server_config['backup_dir_mount_cmd'] = trim($server_config['backup_dir_mount_cmd']);
if($server_config['backup_dir_is_mount'] == 'y' && $server_config['backup_dir_mount_cmd'] != ''){
$backup_dir_mount_cmd = '/usr/local/ispconfig/server/scripts/backup_dir_mount.sh';
if( $server_config['backup_dir_is_mount'] == 'y' &&
is_file($backup_dir_mount_cmd) &&
is_executable($backup_dir_mount_cmd) &&
fileowner($backup_dir_mount_cmd) === 0
){
if(!$app->system->is_mounted($backup_dir)){
exec(escapeshellcmd($server_config['backup_dir_mount_cmd']));
exec($backup_dir_mount_cmd);
sleep(1);
if(!$app->system->is_mounted($backup_dir)) $run_backups = false;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment