Ver Fonte

Move position of backup directory creation to prevent log errors.

Raphael Schneeberger há 7 anos atrás
pai
commit
94de9cdafa
2 ficheiros alterados com 9 adições e 4 exclusões
  1. 5 2
      install/hst-install-debian.sh
  2. 4 2
      install/hst-install-ubuntu.sh

+ 5 - 2
install/hst-install-debian.sh

@@ -13,6 +13,7 @@ VERSION='debian'
 HESTIA='/usr/local/hestia'
 HESTIA='/usr/local/hestia'
 LOG="/root/hst_install_backups/$(date +%s).log"
 LOG="/root/hst_install_backups/$(date +%s).log"
 memory=$(grep 'MemTotal' /proc/meminfo |tr ' ' '\n' |grep [0-9])
 memory=$(grep 'MemTotal' /proc/meminfo |tr ' ' '\n' |grep [0-9])
+hst_backups="/root/hst_install_backups/$(date +%s)"
 arch=$(uname -i)
 arch=$(uname -i)
 os='debian'
 os='debian'
 release=$(cat /etc/debian_version|grep -o [0-9]|head -n1)
 release=$(cat /etc/debian_version|grep -o [0-9]|head -n1)
@@ -272,6 +273,9 @@ fi
 echo "Please wait a few seconds, we update your repository before we start the installation process..."
 echo "Please wait a few seconds, we update your repository before we start the installation process..."
 apt-get -qq update
 apt-get -qq update
 
 
+# Creating backup directory
+mkdir -p $hst_backups
+
 # Checking wget
 # Checking wget
 if [ ! -e '/usr/bin/wget' ]; then
 if [ ! -e '/usr/bin/wget' ]; then
     echo "Install missing wget..."
     echo "Install missing wget..."
@@ -465,8 +469,7 @@ if [ -z "$email" ]; then
     email="admin@$servername"
     email="admin@$servername"
 fi
 fi
 
 
-# Defining backup directory
-hst_backups="/root/hst_install_backups/$(date +%s)"
+# Print backup directory
 echo "Installation backup directory: $hst_backups"
 echo "Installation backup directory: $hst_backups"
 
 
 # Print Log File Path
 # Print Log File Path

+ 4 - 2
install/hst-install-ubuntu.sh

@@ -13,6 +13,7 @@ VERSION='ubuntu'
 HESTIA='/usr/local/hestia'
 HESTIA='/usr/local/hestia'
 LOG="/root/hst_install_backups/$(date +%s).log"
 LOG="/root/hst_install_backups/$(date +%s).log"
 memory=$(grep 'MemTotal' /proc/meminfo |tr ' ' '\n' |grep [0-9])
 memory=$(grep 'MemTotal' /proc/meminfo |tr ' ' '\n' |grep [0-9])
+hst_backups="/root/hst_install_backups/$(date +%s)"
 arch=$(uname -i)
 arch=$(uname -i)
 os='ubuntu'
 os='ubuntu'
 release="$(lsb_release -s -r)"
 release="$(lsb_release -s -r)"
@@ -257,6 +258,9 @@ fi
 echo "Please wait a few seconds, we update your repository before we start the installation process..."
 echo "Please wait a few seconds, we update your repository before we start the installation process..."
 apt-get -qq update
 apt-get -qq update
 
 
+# Creating backup directory
+mkdir -p $hst_backups
+
 # Checking wget
 # Checking wget
 if [ ! -e '/usr/bin/wget' ]; then
 if [ ! -e '/usr/bin/wget' ]; then
     echo "Install missing wget..."
     echo "Install missing wget..."
@@ -437,7 +441,6 @@ if [ -z "$email" ]; then
 fi
 fi
 
 
 # Defining backup directory
 # Defining backup directory
-hst_backups="/root/hst_install_backups/$(date +%s)"
 echo "Installation backup directory: $hst_backups"
 echo "Installation backup directory: $hst_backups"
 
 
 # Print Log File Path
 # Print Log File Path
@@ -499,7 +502,6 @@ apt-key add /tmp/deb_signing.key >> $LOG
 #----------------------------------------------------------#
 #----------------------------------------------------------#
 
 
 # Creating backup directory tree
 # Creating backup directory tree
-mkdir -p $hst_backups
 cd $hst_backups
 cd $hst_backups
 mkdir nginx apache2 php vsftpd proftpd bind exim4 dovecot clamd
 mkdir nginx apache2 php vsftpd proftpd bind exim4 dovecot clamd
 mkdir spamassassin mysql postgresql hestia
 mkdir spamassassin mysql postgresql hestia