Explorar el Código

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
Timo Reymann hace 5 años
padre
commit
3453207301
Se han modificado 1 ficheros con 3 adiciones y 3 borrados
  1. 3 3
      helper-scripts/backup_and_restore.sh

+ 3 - 3
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)"