Skip to content
Snippets Groups Projects

Db Profiles

1 file
+ 6
1
Compare changes
  • Side-by-side
  • Inline
+ 6
1
@@ -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
Loading