Skip to content
Snippets Groups Projects
Commit a2063169 authored by Vladimír Štill's avatar Vladimír Štill
Browse files

bin: Fix journal-checker

parent 372f7921
No related branches found
No related tags found
No related merge requests found
#!/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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment