This program is an attempt to write an intelligent incremental logfile reading utility. Other such utilities exist, but I could find none that would handle changing/dynamic logfiles to my satisfaction. So, having an itch of my own, I scratched it. This code is the result. In summary, something like the following, if run as a cronjob: ``` retail /var/log/messages | mail ``` Will get you all the new entries which happen to show up in your system log. In addition, it will attempt to intelligently cope with any changes to the file in question, by verifying that the data at it's last known position has not changed, and if it has it will search out that same data wherever in the file it now resides. Should this be also impossible, it will resort to rewinding to the beginning of the file and reading the entire thing.

This is a companion discussion topic for the original entry at