#2794 Make parts to restore depend on backup folder contents

master
Timo Reymann 2019-09-08 12:21:12 +02:00
parent 752f2417de
commit 45aa7b45fc
No known key found for this signature in database
GPG Key ID: 6874A594841A0138
1 changed files with 3 additions and 2 deletions

View File

@ -213,7 +213,8 @@ elif [[ ${1} == "restore" ]]; then
fi fi
echo "[ 0 ] all" echo "[ 0 ] all"
FILE_SELECTION[0]="vmail crypt rspamd postfix mysql redis" # 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/\.[^.]*$//')
for file in $(ls -f "${FOLDER_SELECTION[${input_sel}]}"); do for file in $(ls -f "${FOLDER_SELECTION[${input_sel}]}"); do
if [[ ${file} =~ vmail ]]; then if [[ ${file} =~ vmail ]]; then
echo "[ ${i} ] - Mail directory (/var/vmail)" echo "[ ${i} ] - Mail directory (/var/vmail)"
@ -242,7 +243,7 @@ elif [[ ${1} == "restore" ]]; then
fi fi
done done
echo echo
input_sel=0 input_sel=-1
while [[ ${input_sel} -lt 0 || ${input_sel} -gt ${i} ]]; do while [[ ${input_sel} -lt 0 || ${input_sel} -gt ${i} ]]; do
read -p "Select a dataset to restore: " input_sel read -p "Select a dataset to restore: " input_sel
done done