From 95ba89331807ac1cc17f99e5ab888681c0f2ee90 Mon Sep 17 00:00:00 2001 From: Tommy Miland Date: Sat, 9 Nov 2019 09:20:49 +0100 Subject: [PATCH] Add log to logrotation. Added log to logrotation. --- invidious_update.sh | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/invidious_update.sh b/invidious_update.sh index bbc61d2..1d0dd03 100755 --- a/invidious_update.sh +++ b/invidious_update.sh @@ -11,7 +11,7 @@ #### Maintained by @tmiland #### ###################################################################### -version='1.4.0' # Must stay on line 14 for updater to fetch the numbers +version='1.4.1' # Must stay on line 14 for updater to fetch the numbers #------------------------------------------------------------------------------# # @@ -745,6 +745,22 @@ systemd_install() { fi } +logrotate_install() { + if [ -d /etc/logrotate.d ]; then + echo "Adding logrotate configuration..." + echo "/home/invidious/invidious/invidious.log { + rotate 4 + weekly + notifempty + missingok + compress + minsize 1048576 +}" | ${SUDO} tee /etc/logrotate.d/invidious.logrotate + chmod 0644 /etc/logrotate.d/invidious.logrotate + echo " (done)" + fi +} + # Get Crystal get_crystal() { if [[ $(lsb_release -si) == "Debian" || $(lsb_release -si) == "Ubuntu" ]]; then @@ -1110,6 +1126,8 @@ host replication all ::1/128 md5" | ${SUDO} t systemd_install + logrotate_install + show_install_banner sleep 5