From 465b38679636e78db1fdb082af34a2ce3a439156 Mon Sep 17 00:00:00 2001 From: Asif Bacchus Date: Fri, 24 May 2019 23:43:28 -0600 Subject: [PATCH] copy 503 to webroot and log error --- backup_new.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/backup_new.sh b/backup_new.sh index 654d4ef..6797e42 100755 --- a/backup_new.sh +++ b/backup_new.sh @@ -274,6 +274,23 @@ printf "${cyan}[%s] -- [INFO] Log located at ${yellow}%s${cyan} --${norm}\n" \ "$(stamp)" "$logFile" >> "$logFile" +### 503 functionality +if [ $use503 -eq 1 ]; then + printf "${cyan}[%s] -- [INFO] Copying 503 error page to " \ + "$(stamp)" >> "$logFile" + printf "webroot -- ${norm}\n" >> "$logFile" + if ! \cp --force "${err503Path}" "${webroot}/${err503File}" 2>> "$logFile" + then + printf "${yellow}[%s] -- [WARNING] Failed to copy 503 error page. " \ + "$(stamp)" >> "$logFile" + printf "Web users will NOT be notified --${normal}\n" >> "$logFile" + else + printf "${cyan}[%s] -- [INFO] 503 error page copied --${norm}\n" \ + "$(stamp)" >> "$logFile" + fi +fi + + ### stop seahub and seafile service if offline backup requested if [ "$offlineBackup" -eq 1 ]; then seafSvc stop