diff --git a/scripts/loggernet_rotate.sh b/scripts/loggernet_rotate.sh index 2498caf9460a7c1cbf548f39f7d3208381cdeb89..20ca917bab7e8fb95bd57a83d031e87b0304909c 100755 --- a/scripts/loggernet_rotate.sh +++ b/scripts/loggernet_rotate.sh @@ -49,13 +49,14 @@ EOF #} # completes almost every feature of the below for loops -# TODO: if file doesn't exist add the header -# TODO: Handle output file suffix +# specially handles 2400 which should go for the next day, not the past day yyyy_jjj_tower_split() { awk_command=' NR>header_size { time_spec = sprintf("%04d 01 %03d 00 00 00", $2, $3); epoch_seconds = mktime(time_spec); +if ($4 == "2400") + epoch_seconds = epoch_seconds + 86400; file_date = strftime("%Y-%m-%d", epoch_seconds); jday = strftime("%j", epoch_seconds); y = strftime("%Y", epoch_seconds);