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
Re : Set multiple cron jobs in one crontab file samshaw UNIX for Dummies Questions & Answers 3 12-04-2008 01:40 PM
1 script or multiple scripts?? - check files, run jobs jnanasakti Shell Programming and Scripting 6 11-05-2008 01:10 PM
comment jobs in cron for multiple accounts shibajighosh AIX 3 04-08-2008 10:52 AM
Monitoring Server Jobs, Roles, and Performance via Command Line Steve M UNIX for Dummies Questions & Answers 2 07-11-2006 09:03 AM
.netrc multiple ftp jobs to same machine hcclnoodles UNIX for Dummies Questions & Answers 3 03-21-2002 10:32 AM

Reply
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 10-08-2009
vikram3.r vikram3.r is offline
Registered User
  
 

Join Date: Oct 2009
Posts: 9
monitoring multiple jobs Unix

I have a list of jobs. their expected start time and their expected duration.

my needs are
  • monitor multiple jobs (starting at different time and their execution time also differs)
  • Need to mail if any of the job running longer than its expected duration.
Whats the efficient way to scripting & scheduling to monitor the script..??
  #2 (permalink)  
Old 10-08-2009
jp2542a jp2542a is offline
Registered User
  
 

Join Date: Jun 2009
Posts: 142
I would make a wrapper script that would do the following:

Code:
Set a trap for child exit
On child trap, exit because we didn't exceed time

Get commmand and time from command line
execute command in background 

while time < expected
 sleep short time (1 minute?)
 if command not running then exit
end while

Email alert
You don't want to sleep in a shell for the expected time because you won't get the child exit trap until you wake up if the monitored command exited earlier.
Reply

Bookmarks

Tags
monitoring, multiple jobs, unix

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 07:44 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