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

no cd command for restore dump selection

parent 49ab3948
No related branches found
No related tags found
1 merge request!129Db Profiles
......@@ -191,17 +191,20 @@
}
# ------------------------------------------------------------
# restore: show databases that can be restored
# param string file filter optional;
# restore: show databases or dumps of a given database that can be restored
# param string optional: DB-Name for file filter to select from existing dumps;
function listBackupedDBs(){
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| sed "s#^\./##g"
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"
else
ls -ltr "$*__"* | sed "s#^\./##g" | grep -v "\.meta"
find "${BACKUP_TARGETDIR}" -mindepth 1 -maxdepth 1 -type f -name "${1}*" -exec basename {} \; \
| sed "s#^\./##g" | grep -v "\.meta"
fi
cd - >/dev/null
else
color.echo error "ERROR: ${BACKUP_TARGETDIR} does not exist - here are no backups to restore."
echo
......@@ -210,7 +213,7 @@
echo " $(dirname $0)/restore.sh $BACKUP_BASEDIR"
echo "2) Copy restored dumps into $BACKUP_TARGETDIR"
echo "3) Start database restore again"
echo " $(dirname $0)/localdump.sh restore [service]"
echo " $(dirname $0)/localdump.sh restore [profile]"
echo
exit 1
......@@ -515,6 +518,7 @@
test -d "${ARCHIVE_BASEDIR}/${parService}" && BACKUP_BASEDIR="${ARCHIVE_BASEDIR}"
fi
# ----- check if target dir with profile exists
if [ ! -d "${BACKUP_BASEDIR}/${parService}" ]; then
color.echo error "ERROR: Directory does not exist '${BACKUP_BASEDIR}/${parService}'."
exit 1
......@@ -570,7 +574,6 @@
BACKUP_PARAMS=$( dbdetect.getParams )
eval $( dbdetect.setenv )
h2 $BACKUP_SCRIPT $mode "${sDumpfile}" "${sTargetDb}"
. $BACKUP_SCRIPT $mode "${sDumpfile}" "${sTargetDb}"
if [ $? -ne 0 -o $rc -ne 0 ]; then
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment