diff --git a/home.admin/_background.sh b/home.admin/_background.sh index f75e7137..be090550 100755 --- a/home.admin/_background.sh +++ b/home.admin/_background.sh @@ -250,6 +250,30 @@ do fi fi + ############################### + # SYSTEM LOG FILE SIZES + ############################### + + # check every 15min + recheckSync=$(($counter % 900)) + if [ ${recheckSync} -eq 1 ]; then + echo "*** CHECK LOG FILE SIZES ***" + # check if log file is getting too big + logsMegaByte=$(sudo du -c -m /var/log | grep "total" | awk '{print $1;}') + if [ ${logsMegaByte} -gt 5000 ]; then + echo "WARN # Logs /var/log in are bigger then 5GB .. starting repair" + debuginfo=$(ls -la /var/log/ 2>/dev/null) + # dont delete directories - can make services crash + sudo rm /var/log/* + sudo service rsyslog restart + /home/admin/config.scripts/blitz.error.sh _background.sh "log-delete" "REPAIR: /var/log/ >5GB" "Logs in /var/log in were bigger then 5GB and got emergency delete to prevent fillup." "${debuginfo}" + sleep 10 + else + echo "OK - logs are at ${logsMegaByte} MB - within safety limit" + fi + echo "" + fi + #################################################### # MONITOR Initial Syncing of Bitcoin & Lightning # - turn off recovery mode diff --git a/home.admin/_bootstrap.sh b/home.admin/_bootstrap.sh index ffdd1773..1ddbfeec 100755 --- a/home.admin/_bootstrap.sh +++ b/home.admin/_bootstrap.sh @@ -181,6 +181,7 @@ if [ ${logsMegaByte} -gt 1000 ]; then sudo service rsyslog restart /home/admin/_cache.sh set message "WARNING: /var/log/ >1GB" echo "WARN # Logs in /var/log in were bigger then 1GB and got emergency delete to prevent fillup." >> $logFile + sudo ls -la /var/log >> $logFile echo "If you see this in the logs please report to the GitHub issues, so LOG config needs to be optimized." >> $logFile sleep 10 else diff --git a/home.admin/config.scripts/blitz.debug.sh b/home.admin/config.scripts/blitz.debug.sh index fbd9595a..c2e515b7 100755 --- a/home.admin/config.scripts/blitz.debug.sh +++ b/home.admin/config.scripts/blitz.debug.sh @@ -467,6 +467,10 @@ echo "*** SYSTEM CACHE STATUS ***" /home/admin/_cache.sh "export" ln_default | grep -v "ln_default_address" /home/admin/_cache.sh "export" btc_default | grep -v "btc_default_address" +echo "*** POSSIBLE ERROR REPORTS ***" +ls -1 /home/admin/error* 2>/dev/null +echo + echo echo "*** OPTION: SHARE THIS DEBUG OUTPUT ***" echo "An easy way to share this debug output on GitHub or on a support chat"