From 33237750f15eca6da450749a35d517443e7b098a Mon Sep 17 00:00:00 2001 From: Alexander Koch Date: Tue, 6 Dec 2022 14:54:24 +0100 Subject: [PATCH] Feed 'journalctl' stderr into log stream Make errors from `journalctl` itself filterable by integrating its stdout into stream of collected messages. Useful for working around corrupted journal files. --- journalcheck.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/journalcheck.sh b/journalcheck.sh index 0494b2b..b50e956 100755 --- a/journalcheck.sh +++ b/journalcheck.sh @@ -28,7 +28,7 @@ if [ -r "$CURSOR_FILE" ]; then else ARGS+=" -b" fi -journalctl $ARGS > "$LOG" +journalctl $ARGS &> "$LOG" if [ $? -ne 0 ]; then echo "Error: failed to dump system journal" >&2 exit 1