Skip to content

Commit

Permalink
Fix runlogwatch script
Browse files Browse the repository at this point in the history
Use correct values for read command, and remove colors from
output.

Signed-off-by: Riccardo Pittau <[email protected]>
  • Loading branch information
elfosardo committed Feb 26, 2025
1 parent 3a90347 commit 364b33a
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions scripts/runlogwatch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@ LOG_DIR="/shared/log/ironic/deploy"

mkdir -p "${LOG_DIR}"

# shellcheck disable=SC2034
python3 -m pyinotify -e IN_CLOSE_WRITE -v "${LOG_DIR}" |
while read -r path _action file; do
echo "************ Contents of ${path}/${file} ramdisk log file bundle **************"
tar -xOzvvf "${path}/${file}" | sed -e "s/^/${file}: /"
rm -f "${path}/${file}"
while read -r event dir mask maskname filename filepath pathname wd; do
FILENAME=$(echo "$filename" | cut -d'=' -f2- | sed -e 's/\x1b\[[0-9;]*m//g')
FILEPATH=$(echo "$filepath" | cut -d'=' -f2- | sed -e 's/\x1b\[[0-9;]*m//g')
echo "************ Contents of ${FILEPATH}/${FILENAME} ramdisk log file bundle **************"
tar -xOzvvf "${FILEPATH}/${FILENAME}" | sed -e "s/^/${FILENAME}: /"
rm -f "${FILEPATH}/${FILENAME}"
done

0 comments on commit 364b33a

Please sign in to comment.