diff --git a/bare.sh b/bare.sh index 8fbe365..925818c 100755 --- a/bare.sh +++ b/bare.sh @@ -700,7 +700,7 @@ for f in $REPOSTOBACKUP; do fi export RESTIC_EXCLUDEFILE=`getrepoexcludefile "$f"` - if [[ ! -z $RESTIC_PASSWORD_FILE ]]; then + if [[ ! -z $RESTIC_EXCLUDEFILE ]]; then OTHEROPTS="$OTHEROPTS --exclude-file=${RESTIC_EXCLUDEFILE}" fi OTHEROPTS="$OTHEROPTS $RESTICOPTS" @@ -790,11 +790,13 @@ for f in $REPOSTOBACKUP; do elif [[ $mode == "restic" ]]; then if [[ $CMD == "go" ]]; then if [[ $CRONMODE -eq 1 ]]; then - ${RESTIC} backup $AUTHOPTS $CONNECTIONSOPTS $SPEEDOPTS $OTHEROPTS $DATAPATH 2>&1 | egrep "^(Added|processed|snapshot)" >> ${LOG} + {RESTIC} backup $AUTHOPTS $CONNECTIONSOPTS $SPEEDOPTS $OTHEROPTS $DATAPATH 2>&1 | egrep "^(Added|processed|snapshot)" >> ${LOG} + rv=${PIPESTATUS[0]} else + [[ $VERBOSE -eq 1 ]] && log "debug: running: [${RESTIC} backup $AUTHOPTS $CONNECTIONSOPTS $SPEEDOPTS $OTHEROPTS $DATAPATH" ${RESTIC} backup $AUTHOPTS $CONNECTIONSOPTS $SPEEDOPTS $OTHEROPTS $DATAPATH 2>&1 >> ${LOG} + rv=$? fi - rv=$? elif [[ $CMD == "ls" ]]; then ${RESTIC} snapshots $AUTHOPTS $CONNECTIONSOPTS 2>&1 >> ${LOG} rv=$?