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
This commit is contained in:
Jimmy McCrory 2018-11-08 16:48:46 -08:00
parent 93eb9040ab
commit 54fb1055e8
1 changed files with 6 additions and 1 deletions

View File

@ -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
}