The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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
If Then Else Logic jadionne UNIX for Dummies Questions & Answers 7 11-23-2007 04:27 AM
cannot get the logic dineshr85 Shell Programming and Scripting 3 10-11-2007 07:34 AM
Script doesn't work, but commands inside work cheongww UNIX for Dummies Questions & Answers 2 11-14-2006 10:52 PM
Automated FTP to variable directory with error check songtam UNIX for Dummies Questions & Answers 3 04-10-2006 09:57 AM
Status check of Automated FTP anijog Shell Programming and Scripting 5 03-04-2004 02:30 PM

 
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
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 09-01-2008
senthilkumar_ak senthilkumar_ak is offline
Registered User
  
 

Join Date: Aug 2008
Location: Chennai
Posts: 43
Need logic for check automated Job work in awk or SED.

I have a Java program which will automatically trigger some scheduled job to update Db or some other work. I am tracking the jobs with log messages and finding out it is properly run or not. I want to write a script to capture it correctly on time.

Say Job1 is running on 15, 30, and 45 every hour then it leave an entry in the log file that “JOB1 is started”. Like this.

Example for hour 11:00 pm means –

Worker#Scheduler_Worker-3: 23:15:56 105 SendToCM: run() Entry

where “SendToCM: run() Entry” starting log message which Java program write in the log message, '23:15:56' is the time . I need to check the last hour 15 , 30, 45 min log files to find out the entry is their or not then I intimate via mail to me.

i have a logic but not tested yet. For 15 min I am checking with sed like this,

sed -n "/: $h:15:00/,/: $h:15:01/p" schedulerTrace .log > Job1.log

here $h contains the current hour and in the job1.log I’m checking again like

count=grep –c “SendToCM: run() Entry” Job1.log.

if count is zero then the JOB1 is not ran and I need to check exception.
But this logic is very oblique to me. Could you me please help me on finding out a correct logic for this.

Regards,
Senthilkumar.
 

Bookmarks

Tags
awk, grep or, sed

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 08:10 PM.


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