![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | 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 and shell scripting languages here. |
More UNIX and Linux Forum Topics 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 08: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 09:44 AM |
| Need help to create a date script | mredwardlee | Shell Programming and Scripting | 6 | 10-20-2006 11:00 AM |
| Order files by create date | mab_arif16 | Shell Programming and Scripting | 4 | 05-15-2006 02:04 PM |
| Directory create date | Bab00shka | UNIX for Dummies Questions & Answers | 2 | 06-29-2005 11:42 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate 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 |
|
||||
|
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) |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|