From c42f58b09eb9b977840319b7b5d7027aa10f09ad Mon Sep 17 00:00:00 2001 From: Asif Bacchus Date: Tue, 4 Sep 2018 22:20:33 -0600 Subject: [PATCH] Deleted sqlDumpFile after backup completed --- root/scripts/borgbackup.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/root/scripts/borgbackup.sh b/root/scripts/borgbackup.sh index 9ea826f..b4cf80b 100755 --- a/root/scripts/borgbackup.sh +++ b/root/scripts/borgbackup.sh @@ -291,6 +291,18 @@ else echo -e "\e[0;36m...done\e[0m" >> $logFile fi +## Remove sqlDump file +echo -e "\e[1;36m[`date +%Y-%m-%d` `date +%H:%M:%S`] Removing sqlDump" \ + "file...\e[0m" >> $logFile +rm -f "$sqlDumpDir/$sqlDumpFile" &>> $logFile +# verify actually removed +if [ -e "$sqlDumpDir/$sqlDumpFile" ]; then + echo -e "\e[1;33m[`date +%Y-%m-%d` `date +%H:%M:%S`] --Warning--" \ + "Error removing sqldump file. Please remove manually.\e[0m" >> $logFile + echo -e "Script will continue processing..." >> $logFile +else + echo -e "\e[0;36m...done\e[0m" >> $logFile +fi # Gracefully exit