From 54fb1055e8fb82f40db0ef3320a3b7b250a32d1f Mon Sep 17 00:00:00 2001 From: Jimmy McCrory Date: Thu, 8 Nov 2018 16:48:46 -0800 Subject: [PATCH] Publish readable journal files in the gate The published journal files seem to be corrupted when compressed and published to gate logs. Find the journal files and create a text file for each that can be readable within a browser. Remove the original journal files afterwards to conserve space. Change-Id: I5a0bfd465d93570b09175b39291cfe7791c91c3e --- scripts/scripts-library.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/scripts-library.sh b/scripts/scripts-library.sh index 2d2f897201..7c385f33bb 100755 --- a/scripts/scripts-library.sh +++ b/scripts/scripts-library.sh @@ -136,9 +136,14 @@ function find_log_files { } function rename_log_files { + JOURNALCTL_CMD="journalctl --output=short --file" find_log_files |\ while read filename; do \ - mv ${filename} ${filename}.txt || echo "WARNING: Could not rename ${filename}"; \ + if [[ $filename =~ \.journal$ ]]; then + ${JOURNALCTL_CMD} ${filename} > ${filename}.txt || echo "WARNING: Could not rename ${filename}"; \ + else + mv ${filename} ${filename}.txt || echo "WARNING: Could not rename ${filename}"; \ + fi done }