Skip to content

Commit 94de9cd

Browse files
committed
Move position of backup directory creation to prevent log errors.
1 parent fa7ae18 commit 94de9cd

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

install/hst-install-debian.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ VERSION='debian'
1313
HESTIA='/usr/local/hestia'
1414
LOG="/root/hst_install_backups/$(date +%s).log"
1515
memory=$(grep 'MemTotal' /proc/meminfo |tr ' ' '\n' |grep [0-9])
16+
hst_backups="/root/hst_install_backups/$(date +%s)"
1617
arch=$(uname -i)
1718
os='debian'
1819
release=$(cat /etc/debian_version|grep -o [0-9]|head -n1)
@@ -272,6 +273,9 @@ fi
272273
echo "Please wait a few seconds, we update your repository before we start the installation process..."
273274
apt-get -qq update
274275

276+
# Creating backup directory
277+
mkdir -p $hst_backups
278+
275279
# Checking wget
276280
if [ ! -e '/usr/bin/wget' ]; then
277281
echo "Install missing wget..."
@@ -465,8 +469,7 @@ if [ -z "$email" ]; then
465469
email="admin@$servername"
466470
fi
467471

468-
# Defining backup directory
469-
hst_backups="/root/hst_install_backups/$(date +%s)"
472+
# Print backup directory
470473
echo "Installation backup directory: $hst_backups"
471474

472475
# Print Log File Path

install/hst-install-ubuntu.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ VERSION='ubuntu'
1313
HESTIA='/usr/local/hestia'
1414
LOG="/root/hst_install_backups/$(date +%s).log"
1515
memory=$(grep 'MemTotal' /proc/meminfo |tr ' ' '\n' |grep [0-9])
16+
hst_backups="/root/hst_install_backups/$(date +%s)"
1617
arch=$(uname -i)
1718
os='ubuntu'
1819
release="$(lsb_release -s -r)"
@@ -257,6 +258,9 @@ fi
257258
echo "Please wait a few seconds, we update your repository before we start the installation process..."
258259
apt-get -qq update
259260

261+
# Creating backup directory
262+
mkdir -p $hst_backups
263+
260264
# Checking wget
261265
if [ ! -e '/usr/bin/wget' ]; then
262266
echo "Install missing wget..."
@@ -437,7 +441,6 @@ if [ -z "$email" ]; then
437441
fi
438442

439443
# Defining backup directory
440-
hst_backups="/root/hst_install_backups/$(date +%s)"
441444
echo "Installation backup directory: $hst_backups"
442445

443446
# Print Log File Path
@@ -499,7 +502,6 @@ apt-key add /tmp/deb_signing.key >> $LOG
499502
#----------------------------------------------------------#
500503

501504
# Creating backup directory tree
502-
mkdir -p $hst_backups
503505
cd $hst_backups
504506
mkdir nginx apache2 php vsftpd proftpd bind exim4 dovecot clamd
505507
mkdir spamassassin mysql postgresql hestia

0 commit comments

Comments
 (0)