From eaefcd12b3650a4da9d52d372b6906482ad2f590 Mon Sep 17 00:00:00 2001 From: openoms Date: Thu, 16 Apr 2020 19:06:19 +0100 Subject: [PATCH] recreate nginx log dir after log cleanup --- home.admin/_bootstrap.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/home.admin/_bootstrap.sh b/home.admin/_bootstrap.sh index 6a38bfcf4..b94827ab3 100644 --- a/home.admin/_bootstrap.sh +++ b/home.admin/_bootstrap.sh @@ -71,7 +71,15 @@ logsMegaByte=$(sudo du -c -m /var/log | grep "total" | awk '{print $1;}') if [ ${logsMegaByte} -gt 1000 ]; then echo "WARN !! Logs /var/log in are bigger then 1GB" echo "ACTION --> DELETED ALL LOGS" + if [ -d "/var/log/nginx" ]; then + nginxLog=1 + echo "/var/log/nginx is present" + fi sudo rm -r /var/log/* + if [ $nginxLog == 1 ]; then + sudo mkdir /var/log/nginx + echo "Recreated /var/log/nginx" + fi sleep 3 echo "WARN !! Logs in /var/log in were bigger then 1GB and got emergency delete to prevent fillup." echo "If you see this in the logs please report to the GitHub issues, so LOG config needs to hbe optimized."