@@ -442,8 +442,9 @@ _s_inf "INFO: Backup job started: ${_start_backup_date}"
442442DEFAULTS_FILE_FLAG=
443443[ -n " ${DEFAULTS_FILE} " ] && DEFAULTS_FILE_FLAG=" --defaults-file=${DEFAULTS_FILE} "
444444# Check for innobackupex
445- _ibx=$( which innobackupex)
446- if [ " $? " -gt 0 ]; then _d_inf " ERROR: Could not find innobackupex binary!" ; fi
445+ if ! _ibx=$( command -v innobackupex) ; then
446+ _d_inf ' ERROR: Could not find innobackupex binary!'
447+ fi
447448if [ -n ${DEFAULTS_FILE} ]; then _ibx=" ${_ibx} ${DEFAULTS_FILE_FLAG} " ; fi
448449if [ " x${GALERA_INFO} " = " x1" ]; then _ibx=" ${_ibx} --galera-info" ; fi
449450
463464#
464465# Determine what will be our --incremental-basedir
465466#
466- if [ " ${BKP_TYPE} " = " incr" ];
467- then
468- if [ -n " ${INC_BSEDIR} " ];
469- then
470- if [ ! -d ${WORK_DIR} /bkps/${INC_BSEDIR} ];
471- then
467+ if [ " ${BKP_TYPE} " = " incr" ]; then
468+ if [ -n " ${INC_BSEDIR} " ]; then
469+ if [ ! -d ${WORK_DIR} /bkps/${INC_BSEDIR} ]; then
472470 _d_inf " ERROR: Specified incremental basedir ${WORK_DIR} /bkps/${_inc_basedir} does not exist." ;
473471 fi
474472
@@ -477,17 +475,15 @@ then
477475 _inc_basedir=${_last_bkp}
478476 fi
479477
480- if [ ! -n " ${_inc_basedir} " ];
481- then
478+ if [ ! -n " ${_inc_basedir} " ]; then
482479 _d_inf " ERROR: No valid incremental basedir found!" ;
483480 fi
484481
485482 ( [ " x${APPLY_LOG} " = " x1" ] || [ " x${STOR_CMP} " = " x1" ] ) && \
486483 _inc_basedir_path=" ${WORK_DIR} /bkps/${_inc_basedir} " || \
487484 _inc_basedir_path=" ${STOR_DIR} /bkps/${_inc_basedir} "
488485
489- if [ ! -d " ${_inc_basedir_path} " ];
490- then
486+ if [ ! -d " ${_inc_basedir_path} " ]; then
491487 _d_inf " ERROR: Incremental basedir ${_inc_basedir_path} does not exist." ;
492488 fi
493489
@@ -662,17 +658,14 @@ if [ "${status}" != 1 ]; then
662658 _start_prepare_date=$( date)
663659 _s_inf " INFO: Apply log started: ${_start_prepare_date} "
664660
665- if [ " ${BKP_TYPE} " = " incr" ];
666- then
667- if [ ! -n " ${_incr_base} " ];
668- then
661+ if [ " ${BKP_TYPE} " = " incr" ]; then
662+ if [ ! -n " ${_incr_base} " ]; then
669663 _d_inf " ERROR: No valid base backup found!" ;
670664 fi
671665
672666 _incr_base=P_${_incr_base}
673667
674- if [ ! -d " ${WORK_DIR} /bkps/${_incr_base} " ];
675- then
668+ if [ ! -d " ${WORK_DIR} /bkps/${_incr_base} " ]; then
676669 _d_inf " ERROR: Base backup ${WORK_DIR} /bkps/${_incr_base} does not exist." ;
677670 fi
678671 _ibx_prep=" ${_ibx_prep} --apply-log --redo-only ${WORK_DIR} /bkps/${_incr_base} --incremental-dir ${_this_bkp} "
0 commit comments