diff --git a/localdump.sh b/localdump.sh index 96f52f58b61bb4fab7e3f02191478a988fb33d45..2d8be9d7ba402b0f4e1db7235ee0b2d6ab83e7fa 100755 --- a/localdump.sh +++ b/localdump.sh @@ -12,6 +12,7 @@ # 2017-03-27 ..... added first param for mode backup|restore # 2018-02-09 ..... fix: restore-selection of target uses default on return only # 2021-05-18 ..... move supported backup types to plugins/localdump/[service].sh +# 2021-07-13 ..... remove leading ./ in localdump.sh restore # ====================================================================== @@ -169,15 +170,24 @@ if [ -d "${BACKUP_TARGETDIR}" ]; then cd "${BACKUP_TARGETDIR}" if [ -z $1 ]; then - find -type f | sed "s#__[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]-[0-9][0-9].*##g" | grep -v ".meta" | sort -ud + find -type f | sed "s#__[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]-[0-9][0-9].*##g" | grep -v ".meta" | sort -ud| sed "s#^\./##g" else - ls -ltr "$*__"* + ls -ltr "$*__"* | sed "s#^\./##g" fi cd - >/dev/null else color error - echo ERROR: here are no backups for this db type + echo ERROR: ${BACKUP_TARGETDIR} does not exist - here are no backups to restore. color reset + echo + echo You can try to restore dumps: + echo "1) Restore dump files from a backup set" + echo " `dirname $0`/restore.sh $BACKUP_BASEDIR" + echo "2) Move restored dumps into $BACKUP_TARGETDIR" + echo "3) Start database restore again" + echo " `dirname $0`/localdump.sh restore" + echo + exit 1 fi } @@ -354,7 +364,7 @@ else . $BACKUP_SCRIPT $mode "${sDumpfile}" "${sTargetDb}" - if [ $rc -ne 0 ]; then + if [ $? -ne 0 -o $rc -ne 0 ]; then color error echo ERROR: $mode failed. See ouput above. :-/ color reset