From 34532073010d000d747da457982de0f76eef4a4c Mon Sep 17 00:00:00 2001 From: Timo Reymann Date: Thu, 14 Nov 2019 09:35:57 +0100 Subject: [PATCH] Make restore not only find .tar.gz but also .gz for mysql backup (#3113) * Make restore not only find .tar.gz but also .gz for mysql backup * Fix coment for changed restore * Fix cosmetic for selection --- helper-scripts/backup_and_restore.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/helper-scripts/backup_and_restore.sh b/helper-scripts/backup_and_restore.sh index cf590f21..6f77cab0 100755 --- a/helper-scripts/backup_and_restore.sh +++ b/helper-scripts/backup_and_restore.sh @@ -220,9 +220,9 @@ elif [[ ${1} == "restore" ]]; then exit 1 fi - echo "[ 0 ] all" - # find all files in folder with .tar.gz extension, print their base names, remove backup_, remove .tar, remove .gz - FILE_SELECTION[0]=$(find "${FOLDER_SELECTION[${input_sel}]}" -type f -name "*.tar.gz" -printf "%f\n" | sed 's/backup_*//' | sed 's/\.[^.]*$//' | sed 's/\.[^.]*$//') + echo "[ 0 ] - all" + # find all files in folder with *.gz extension, print their base names, remove backup_, remove .tar (if present), remove .gz + FILE_SELECTION[0]=$(find "${FOLDER_SELECTION[${input_sel}]}" -type f -name '*.gz' -printf '%f\n' | sed 's/backup_*//' | sed 's/\.[^.]*$//' | sed 's/\.[^.]*$//') for file in $(ls -f "${FOLDER_SELECTION[${input_sel}]}"); do if [[ ${file} =~ vmail ]]; then echo "[ ${i} ] - Mail directory (/var/vmail)"