Please post sample lines, including a sample alarm line. Please state the largest size of the log, the largest number of records and the frequency of starting a new log. The main issue is that the "
awk" in the script pipes a number of strings containing "date" to "sh" but does not end the stream to allow "sh" to execute the commands. The approach is flawed.