From 05adfefe7163f4d59adeed6f44db7689d096b446 Mon Sep 17 00:00:00 2001 From: VirtuBox Date: Mon, 25 Mar 2019 10:09:53 +0100 Subject: [PATCH] fix backup --- install | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/install b/install index 9f2b424..acf5c3d 100644 --- a/install +++ b/install @@ -83,7 +83,7 @@ fi ### wo_branch="$1" readonly wo_log_dir=/var/log/wo/ -readonly wo_backup_dir=/var/lib/wo-backup +readonly wo_backup_dir=/var/lib/wo-backup/ readonly wo_install_log=/var/log/wo/install.log readonly wo_linux_distro=$(lsb_release -is) readonly wo_distro_version=$(lsb_release -sc) @@ -124,16 +124,20 @@ if [ ! -d "$wo_log_dir" ]; then wo_lib_echo "Creating WordOps log directory, just a second..." mkdir -p "$wo_log_dir" || wo_lib_error "Whoops - seems we are unable to create the log directory $wo_log_dir, exit status " $? - wo_lib_echo "Creating WordOps backup directory, just a second..." - mkdir -p "$wo_backup_dir" || wo_lib_error "Whoops - seems we are unable to create the backup directory $wo_backup_dir, exit status " $? - chmod -R 600 "$wo_backup_dir" - # create wordops log files touch /var/log/wo/{wordops.log,install.log} chmod -R 700 /var/log/wo || wo_lib_error "Whoops, there was an error setting the permissions on the WordOps log folder, exit status " $? fi +if [ ! -d "$wo_backup_dir" ]; then + + wo_lib_echo "Creating WordOps backup directory, just a second..." + mkdir -p "$wo_backup_dir" || wo_lib_error "Whoops - seems we are unable to create the backup directory $wo_backup_dir, exit status " $? + chmod -R 600 "$wo_backup_dir" + +fi + ### # 2 - Setup the dependencies for installation #### @@ -389,7 +393,6 @@ wo_install() { } - wo_upgrade_nginx() { {