diff --git a/localdump.sh b/localdump.sh index 8859830a08a99570a704a47f57ed13f1a6738536..20683f5e05969e378fbee6a663ea8538f09e87b5 100755 --- a/localdump.sh +++ b/localdump.sh @@ -183,7 +183,7 @@ # restore: show profiles from that exist backups # global string BACKUP_BASEDIR base directory of all backups function listBackupedServices(){ - find "${BACKUP_BASEDIR}" -mindepth 1 -maxdepth 1 -type d | sed "s#^${BACKUP_BASEDIR}/##g" | sort + find "${BACKUP_BASEDIR}" -mindepth 1 -maxdepth 1 -type d | sed "s#^${BACKUP_BASEDIR}/##g" | sort | grep "^[a-z]" } # ------------------------------------------------------------ @@ -449,6 +449,12 @@ restore) h1 "RESTORE DATABASE" + + if ! listBackupedServices; then + color.echo error "ERROR: No database dump was found in [${BACKUP_BASEDIR}]." + exit 1 + fi + if [ -z $1 ] || [ ! -f "$1" ]; then parService="$1"