From fe6034d06f107287dbe94bf6eff3fdcd6e976f51 Mon Sep 17 00:00:00 2001
From: "Hahn Axel (hahn)" <axel.hahn@iml.unibe.ch>
Date: Tue, 13 Jul 2021 13:34:45 +0200
Subject: [PATCH] remove ./ in output of localdump.sh restore; add db restore
 hint

---
 localdump.sh | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/localdump.sh b/localdump.sh
index 96f52f5..a467021 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
   }
-- 
GitLab