From a2063169c053c46e07fc3d93ce3ce1f8cdeef040 Mon Sep 17 00:00:00 2001 From: Vladimir Still <git@vstill.eu> Date: Tue, 25 Jan 2022 07:46:41 +0100 Subject: [PATCH] bin: Fix journal-checker --- bin/journal-checker | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/bin/journal-checker b/bin/journal-checker index abd3eaf..aeebedf 100755 --- a/bin/journal-checker +++ b/bin/journal-checker @@ -1,7 +1,7 @@ #!/usr/bin/env -S chronic bash set -e -umask 600 +umask 077 STAMPFILE=$HOME/.journal-checker.stamp @@ -11,10 +11,15 @@ else SINCE="--since=$(head -n1 $STAMPFILE)" fi +filter() { + grep -v 'systemd-tmpfiles.*: Detected autofs mount point /home during canonicalization of /home.$' | \ + grep -v 'systemd-xdg-autostart-generator' +} + NOW=$(date +"%Y-%m-%d %H:%M") LOG=$(mktemp --tmpdir .journal-checker.XXXXXX.log) trap "rm -f $LOG" EXIT QUIT TERM -journalctl -oshort-iso-precise --full --no-pager -p warning "$SINCE" | tee $LOG +journalctl -oshort-iso-precise --full --no-pager -p warning "$SINCE" | filter | tee $LOG ERRORS=$(cat $LOG | fgrep -v -- '-- No entries --' | fgrep -v -- '-- Journal begins at ' | wc -l) echo "($ERRORS errors)" @@ -30,3 +35,5 @@ fi echo $NOW > $STAMPFILE exit $RC + +# vim: ft=bash -- GitLab