Taking into account the time it takes to send, receive, pop, and read a mail msg, even if someone in that group, twiddling their thumbs, is constantly checking their mails, examining the log file every second is overkill, even per minute is too much. Five minutes might be a good interval. Do your log file lines/entries have time stamps?
Agreed. my intention was to check periodically and it is not yet decided to what are the time intervals the cronjob needs to check.
For now just think that its 5 minutes and yes my log file has timestamps, please find the log :
Mar 5 02:52:20 app21 info message received invalid license for the license number 21345.
Mar 5 02:52:49 app21 messages processed successfully
Mar 5 02:57:48 app21 info message received invalid license for the license number 732900.
Mar 5 02:58:50 app21 messages processed successfully
Mar 5 02:58:50 app21 messages processed successfully
I was thinking about comparing time stamps between last run and actual run, but that might be too coarse a criterion.
Create a little awk script that picks the previous last line no. from a file, skips all lines up to that no., checks the lines to EOF, creating your mail text, and saves the last line from this run in above file for the next run.