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

detect non existing backups

parent 5faf555a
Branches
No related tags found
1 merge request!129Db Profiles
......@@ -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"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment