Changeset 1228


Ignore:
Timestamp:
Dec 5, 2016, 4:31:09 PM (7 years ago)
Author:
joergs
Message:

reposync-mirror-update.sh: continue on error, but show summary at the
end and exit with exitcode.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • dass-tools/usr/bin/reposync-mirror-update.sh

    r1227 r1228  
    66
    77set -o errexit -o nounset
     8
     9REPOSYNC_FAILED=""
    810
    911if [ -r /etc/dass-it/reposync.conf ]; then
     
    7577   
    7678    # exit on errors
    77     LOG=$(reposync --config $REPO_FILE --cachedir=$CACHEDIR --delete)
    78    
    79     if grep "Downloading\|Removing" <<< "$LOG"; then
     79    if ! LOG=$(reposync --config $REPO_FILE --cachedir=$CACHEDIR --delete); then
     80
     81        printf "FAILED: reposync failed:\n%s" "$LOG" >&2
     82        REPOSYNC_FAILED="${REPOSYNC_FAILED}${DIR} "
     83
     84    elif grep "Downloading\|Removing" <<< "$LOG"; then
    8085
    8186      test -L $NAME && rm $NAME
     
    102107rm -r $TMPDIR
    103108
    104 echo
    105 echo "$ME: done"
     109printf "\n\n"
     110
     111if [ "$REPOSYNC_FAILED" ]; then
     112    printf "$ME failed on:\n%s\n" "$REPOSYNC_FAILED"
     113    exit 1
     114fi
     115
     116printf "$ME: done\n"
Note: See TracChangeset for help on using the changeset viewer.