in reply to How can one open a filehandle in realtime or current log
avoid getting repeated emails until the hour changes.
To meet those requirements:
To avoid "getting repeat emails", you need to avoid asking for files that will include repeat emails.
And to do that, that is, to get nothing "until the hour changes", you would need to know what the last hour you processed was.
In order to do that you would need to store the hour that you last processed. There are several ways you might do that:
Create a file containing the hour that you last processed before your script exits; and re-read that file at the start of each run of the script, and use that in place of your backticked call to date.
Ie. Create a file in a known place with a name (say) '%hour%.last', that you can use to obtain the last hour processed; and use that in place of your backticked call to date.
And use that in place of your backticked call to date.
Update:Thinking about it, the latter won't work unless you can arrange for the next instantiation of the script to get the modified environment rather its predecessor's inherited environment; which probably isn't the case.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How can one open a filehandle in realtime or current log
by Laurent_R (Canon) on Mar 16, 2016 at 23:33 UTC | |
by BrowserUk (Patriarch) on Mar 17, 2016 at 00:02 UTC |