From 98e901eb118c16006b0114fe4fed8726a16c8e30 Mon Sep 17 00:00:00 2001 From: Asif Bacchus Date: Wed, 19 Sep 2018 17:08:52 -0600 Subject: [PATCH] Generate sqlDumpFile name --- backup.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/backup.sh b/backup.sh index ac1e41a..4daaf0f 100755 --- a/backup.sh +++ b/backup.sh @@ -154,10 +154,14 @@ echo -e "${bold}${stamp}-- Start $scriptName execution ---" >> "$logFile" export logFile="$logFile" -### Create sqlDump temporary directory +### Create sqlDump temporary directory and sqlDumpFile name sqlDumpDir=$( mktemp -d ) echo -e "${cyan}${stamp} Created temp dir for SQLdump: $sqlDumpDir" \ >> "$logFileVerbose" +sqlDumpFile="backup-`date +%Y%m%d_%H%M%S`.sql" +echo -e "${normal}${stamp} mySQL dump file will be stored at:" \ + "${bold}${yellow}${sqlDumpDir}/${sqlDumpFile}${normal}" \ + | tee -a "$logFileNormal" "$logFileVerbose" # This code should not be executed since the 'quit' function should terminate