From 420c12de4e0ef583935265f8a497d7cf6aaaa36e Mon Sep 17 00:00:00 2001
From: Brandon Rodriguez <brodriguez8774@gmail.com>
Date: Thu, 11 Mar 2021 19:32:36 -0500
Subject: [PATCH] Minor correction to backup script

---
 backups/backup_mysql.sh | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/backups/backup_mysql.sh b/backups/backup_mysql.sh
index 81b9e97..4fe0ad1 100755
--- a/backups/backup_mysql.sh
+++ b/backups/backup_mysql.sh
@@ -131,6 +131,14 @@ function validate_args () {
         get_absolute_path "${kwargs[backup_path]}"
         backup_folder="${return_value}"
     fi
+
+    # Validate backup folder.
+    if [[ ! -d ${backup_folder} ]]
+    then
+        echo -e "${text_red}Provided backup location is not a folder, or does not exist.${text_reset}"
+        echo -e "${text_red}Please verify the location exists, and that the location points to a folder, not a file.${text_reset}"
+        exit 0
+    fi
 }
 
 
-- 
GitLab