Skip to content
Snippets Groups Projects
Verified Commit 030de998 authored by David Hoese's avatar David Hoese
Browse files

Fix handling unexpected loggernet output

parent 4473c12e
No related branches found
No related tags found
No related merge requests found
...@@ -52,7 +52,7 @@ EOF ...@@ -52,7 +52,7 @@ EOF
# specially handles 2400 which should go for the next day, not the past day # specially handles 2400 which should go for the next day, not the past day
yyyy_jjj_tower_split() { yyyy_jjj_tower_split() {
awk_command=' awk_command='
NR>header_size { (NR>header_size) && ($1 == "1") {
time_spec = sprintf("%04d 01 %03d 00 00 00", $2, $3); time_spec = sprintf("%04d 01 %03d 00 00 00", $2, $3);
epoch_seconds = mktime(time_spec); epoch_seconds = mktime(time_spec);
if ($4 == "2400") if ($4 == "2400")
...@@ -110,7 +110,12 @@ for file_suffix in $FILE_SUFFIXES; do ...@@ -110,7 +110,12 @@ for file_suffix in $FILE_SUFFIXES; do
yyyy_jjj_tower_split $input_file yyyy_jjj_tower_split $input_file
# copy the header back to the original file # copy the header back to the original file
cp $header_fn $input_file if [ -s $header_fn ]; then
cp $header_fn $input_file
else
# loggernet doesn't like empty destination files
rm $input_file
fi
# remove the temporary header file # remove the temporary header file
rm ${header_fn} rm ${header_fn}
......
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