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 here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
command to terminate munna_dude High Level Programming 2 01-25-2007 07:59 AM
Interrupt signal Control C takes too long to terminate a process paqui UNIX for Advanced & Expert Users 8 10-17-2005 07:30 AM
Terminate process ust Shell Programming and Scripting 5 07-12-2005 05:56 AM
terminate the process ust Shell Programming and Scripting 2 05-18-2005 02:53 AM
How to terminate a tail -f DonVince Shell Programming and Scripting 4 09-11-2002 09:17 PM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 06-21-2005
ust ust is offline
Registered User
 

Join Date: Feb 2005
Posts: 95
terminate process

I want to have a script to terminate the system process that generated by user oracle_usr and have already processed for over 10 minutes , could suggest the script ? thx
Reply With Quote
Forum Sponsor
  #2  
Old 06-21-2005
...@...
 

Join Date: Feb 2004
Location: NM
Posts: 4,298
Tuning Oracle scripts is better than killing processes - FWIW.

Remove the # from in front of
Code:
#     . ./temp.sh
line
after you have reviewed the temp.sh file and you are sure it is getting right processes.
This code loops with a one minute sleep - you may wabnt to change it not to loop.
Code:
#!/bin/ksh
while true
do 
    ps -ef | awk '{if($1=="oracle"){ 
                     sub(/:/,"",$7)
                     if($7 > 1000 ){
                        printf("kill -9 %s #  %s\n",$2, $0)
                     }                                  
                  }} ' > temp.sh
    if [ -s temp.sh ]; then              
         chmod +x temp.sh
    #     . ./temp.sh
    fi
    sleep 60
done    
exit
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 11:55 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0