|
Create a script using DATE command?
Not even sure how to word this.
Basically, we have a log file that gathers all alerts for a system.
What I am doing is grepping through this file and grabbing certain strings that are outputted to a file, then mailed to a group.
Here is the catch. Since I cannot copy this file to a temp file and empty the contents of the original file (essentially, making the original file clean and empty and backing up the copy of the original file), I am now trying to only gather events that occur after certain times.
My thinking is that I have to use the date command. This script is going to run every 15 minutes. So, the trick is, how do I create the script to email me only any NEW alerts that occur every 15 minutes? Does that make sense?
Example:
1:00 - Script runs for the first time. No new errors, so nothing is emailed.
1:15 - Script runs again, this time, new errors. I want these errors to be emailed to the group.
I appreciate it.
TCG
|