#!/bin/bash ## Script Location SCRIPTDIR=$(dirname $0) source "$SCRIPTDIR/common/colors.sh" source "$SCRIPTDIR/common/functions.sh" source "$SCRIPTDIR/common/load-defaults.sh" printf "$COL_LIGHT_BLUE" "* Vaccuming Systemd Journal" journalctl --vacuum-size=50M printf "$COL_LIGHT_BLUE" "* Checking for Systemd Journal directory" journal_directory="/var/log/journal" if [ ! -d "$journal_directory" ]; then printf "$COL_YELLOW" "** creating Systemd Journal installation directory" mkdir $journal_directory fi systemd_journald_conf="/etc/systemd/journald.conf" if (whiptail --title "Systemd Journalling limits" --yes-button "yes" --no-button "no" --yesno "Do You want to limit systemd journalling?" 10 80) then if [[ $(grep -L "Change Logging maximums" $systemd_journald_conf) ]]; then printf "$COL_YELLOW" "** Limitting" cat <> $systemd_journald_conf #Change Logging maximums RuntimeMaxFileSize=50 RuntimeMaxFiles=100 EOT else printf "$COL_YELLOW" "** not limitting" fi fi systemctl restart systemd-journald