Till Brehm
2014-07-29 061d7c84c49b9e63c311123f52a142fc66b4228f
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.
5 files modified
24 ■■■■ changed files
install/tpl/server.ini.master 1 ●●●● patch | view | raw | blame | history
interface/web/admin/form/server_config.tform.php 8 ●●●●● patch | view | raw | blame | history
interface/web/admin/lib/lang/en_server_config.lng 1 ●●●● patch | view | raw | blame | history
interface/web/admin/templates/server_config_server_edit.htm 4 ●●●● patch | view | raw | blame | history
server/cron_daily.php 10 ●●●● patch | view | raw | blame | history
install/tpl/server.ini.master
@@ -16,7 +16,6 @@
admin_notify_events=1
backup_dir=/var/backup
backup_dir_is_mount=n
backup_dir_mount_cmd=
backup_mode=rootgz
monit_url=
monit_user=
interface/web/admin/form/server_config.tform.php
@@ -177,14 +177,6 @@
            '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',
interface/web/admin/lib/lang/en_server_config.lng
@@ -189,6 +189,5 @@
$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';
?>
interface/web/admin/templates/server_config_server_edit.htm
@@ -65,10 +65,6 @@
                    {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>
                <select name="backup_mode" id="backup_mode" class="selectInput">
server/cron_daily.php
@@ -1104,10 +1104,14 @@
    
    //* 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;
        }