Skip to content
Snippets Groups Projects
Commit 86515e19 authored by Hahn Axel (hahn)'s avatar Hahn Axel (hahn)
Browse files

update localdump

parent 3b69a5b3
Branches
No related tags found
1 merge request!129Db Profiles
...@@ -192,15 +192,19 @@ ...@@ -192,15 +192,19 @@
# ------------------------------------------------------------ # ------------------------------------------------------------
# restore: show databases or dumps of a given database that can be restored # 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; # param string optional: DB-Name for file filter to select from existing dumps;
function listBackupedDBs(){ function listBackupedDBs(){
if [ -d "${BACKUP_TARGETDIR}" ]; then if [ -d "${BACKUP_TARGETDIR}" ]; then
if [ -z $1 ]; then if [ -z $1 ]; then
# list all databases
find "${BACKUP_TARGETDIR}" -mindepth 1 -maxdepth 1 -type f -exec basename {} \; \ 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" \ | 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 else
# list dumps of a database
find "${BACKUP_TARGETDIR}" -mindepth 1 -maxdepth 1 -type f -name "${1}*" -exec basename {} \; \ find "${BACKUP_TARGETDIR}" -mindepth 1 -maxdepth 1 -type f -name "${1}*" -exec basename {} \; \
| sed "s#^\./##g" | grep -v "\.meta" | sed "s#^\./##g" | grep -v "\.meta"
fi fi
...@@ -525,6 +529,7 @@ ...@@ -525,6 +529,7 @@
fi fi
BACKUP_TARGETDIR="${BACKUP_BASEDIR}/${parService}" BACKUP_TARGETDIR="${BACKUP_BASEDIR}/${parService}"
ARCHIVE_DIR=${ARCHIVE_BASEDIR}/${PROFILENAME}
h2 "Select database" h2 "Select database"
listBackupedDBs listBackupedDBs
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment