From 0f80a3b46606138a34e68548c623b3d9e3fc03cd Mon Sep 17 00:00:00 2001 From: Asif Bacchus Date: Tue, 4 Sep 2018 20:28:52 -0600 Subject: [PATCH] Added error-check for maint. mode --- root/scripts/borgbackup.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/root/scripts/borgbackup.sh b/root/scripts/borgbackup.sh index f99479e..e1f9ef6 100755 --- a/root/scripts/borgbackup.sh +++ b/root/scripts/borgbackup.sh @@ -173,7 +173,19 @@ else fi ## Put NextCloud in maintenance mode +echo -e "\e[1;36m[`date +%Y-%m-%d` `date +%H:%M:%S`] Putting NextCloud" \ + "in maintenance mode..." >> $logFile sudo -u ${webUser} php "${ncroot}/occ maintenance:mode --on" 2>> $logFile +# verify +if [ "$?" = "0" ]; then + echo -e "\e[0;36m...done\e[0m" >> $logFile +else + echo -e "\e[1;33m--Warning-- There was a problem putting NextCloud" \ + "into maintenance mode" >> $logFile + echo -e "\e[1;39mScript will continue..." >> $logFile +fi + + ## Read sqlDetails file and extract necessary information mapfile -t sqlParams < $sqlDetails