diff --git a/localdump.sh b/localdump.sh index 39d42968ae8f5c5a567fbc5972b3f290d61358da..b9bfb45c1a3ddecbafccafd8cdf1f6214efcd602 100755 --- a/localdump.sh +++ b/localdump.sh @@ -192,15 +192,19 @@ # ------------------------------------------------------------ # restore: show databases or dumps of a given database that can be restored + # global string BACKUP_BASEDIR base directory of all backups of selected dbprofile # param string optional: DB-Name for file filter to select from existing dumps; function listBackupedDBs(){ if [ -d "${BACKUP_TARGETDIR}" ]; then if [ -z $1 ]; then + # list all databases find "${BACKUP_TARGETDIR}" -mindepth 1 -maxdepth 1 -type f -exec basename {} \; \ | 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" + | sed "s#\..*##g" \ + | sort -ud| sed "s#^\./##g" else + # list dumps of a database find "${BACKUP_TARGETDIR}" -mindepth 1 -maxdepth 1 -type f -name "${1}*" -exec basename {} \; \ | sed "s#^\./##g" | grep -v "\.meta" fi @@ -525,6 +529,7 @@ fi BACKUP_TARGETDIR="${BACKUP_BASEDIR}/${parService}" + ARCHIVE_DIR=${ARCHIVE_BASEDIR}/${PROFILENAME} h2 "Select database" listBackupedDBs