瀏覽代碼

Resolve #2794 Add restore for 'all'

Timo Reymann 6 年之前
父節點
當前提交
752f2417de
共有 1 個文件被更改,包括 4 次插入1 次删除
  1. 4 1
      helper-scripts/backup_and_restore.sh

+ 4 - 1
helper-scripts/backup_and_restore.sh

@@ -211,6 +211,9 @@ elif [[ ${1} == "restore" ]]; then
     echo "No datasets found"
     echo "No datasets found"
     exit 1
     exit 1
   fi
   fi
+
+  echo "[ 0 ] all"
+  FILE_SELECTION[0]="vmail crypt rspamd postfix mysql redis"
   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)"
@@ -240,7 +243,7 @@ elif [[ ${1} == "restore" ]]; then
   done
   done
   echo
   echo
   input_sel=0
   input_sel=0
-  while [[ ${input_sel} -lt 1 ||  ${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
   echo "Restoring ${FILE_SELECTION[${input_sel}]} from ${RESTORE_POINT}..."
   echo "Restoring ${FILE_SELECTION[${input_sel}]} from ${RESTORE_POINT}..."