The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



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

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 05-15-2008
thecoffeeguy thecoffeeguy is offline
Registered User
  
 

Join Date: May 2008
Posts: 7
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
  #2 (permalink)  
Old 05-15-2008
fabtagon fabtagon is offline
Registered User
  
 

Join Date: Apr 2008
Location: European Union/Germany
Posts: 189
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)
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 01:45 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0