How can I use tail utility to view a log file that is frequently recreated

Viewed 14485

I need a solution in creating a script to tail a log file that is recreated (with the same name) after it reaches a certain size.

Using "tail -f" causes the tailing to stop when the file is recreated/rotated.

What I would like to do is create a script that would tail the file and after it reaches 100 lines for example, then restart the command... Or even better to restart the command when the file is recreated?

Is it possible?

4 Answers
Related