![]() |
|
|
|||||||
| Home | Forums | Register | Rules & FAQ | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. Shell Script Page. |
Other UNIX.COM Threads You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| trying to create a script to read a flie and loop a command... | Italy87 | UNIX Desktop for Dummies Questions & Answers | 5 | 03-26-2008 04:36 AM |
| trying to create a script to read a flie and loop a command... | Italy87 | UNIX for Advanced & Expert Users | 1 | 03-25-2008 05:44 AM |
| Need help to create a date script | mredwardlee | Shell Programming and Scripting | 6 | 10-20-2006 07:00 AM |
| Order files by create date | mab_arif16 | Shell Programming and Scripting | 4 | 05-15-2006 10:04 AM |
| Directory create date | Bab00shka | UNIX for Dummies Questions & Answers | 2 | 06-29-2005 07:42 AM |
![]() |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|||
|
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 |
| Forum Sponsor | ||
|
|
|
|||
|
i) grep out the dates and compare whether or not the incidents happened in the last 15 minutes
ii) use logcheck, a complete, mature package that exactly does what you want (it even takes care about what is relevant (can be hand-tuned) to be reported and what not) |
|||
| Google UNIX.COM |