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

restore edge case: single dump in backup folder

parent 2e9f8353
No related branches found
No related tags found
1 merge request!129Db Profiles
......@@ -551,6 +551,11 @@ EOH
h2 "Select a specific dump for that database"
showSelectAndInput "$(listBackupedDBs $fileprefix)" "Backupset to import"
dbfile="$LASTINPUT"
# if there is a single dump in backup folder:
# '-rw-r--r-- 1 root root 481 Mar 13 12:27 ahcrawler__20240313-1227.sql.gz'
# --> take the last part behind the last space to get a filename
grep "^-[rwxsSt\-]* " <<< "$LASTINPUT" && dbfile="$(rev <<< \'"$LASTINPUT"\' | cut -d ' ' -f 1 | rev)"
echo
sTargetDb=$(guessDB ${dbfile})
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment