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.
| | |
| | | admin_notify_events=1 |
| | | backup_dir=/var/backup |
| | | backup_dir_is_mount=n |
| | | backup_dir_mount_cmd= |
| | | backup_mode=rootgz |
| | | monit_url= |
| | | monit_user= |
| | |
| | | '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', |
| | |
| | | $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'; |
| | | ?> |
| | |
| | | {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"> |
| | |
| | | |
| | | //* 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; |
| | | } |