LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > AIX
User Name
Password
AIX This forum is for the discussion of IBM AIX.
eserver and other IBM related questions are also on topic.

Notices

Reply
 
LinkBack Search this Thread
Old 11-18-2009, 12:36 AM   #1
shipon_97
Member
 
Registered: Oct 2005
Location: Bangladesh
Posts: 432

Rep: Reputation: 30
Kill IDLE Process using script !!!


Dear Friends ,
I am using DB2 database in AIX 5.3 server . In my server some IDLE process are generated after several times which I need to kill it manually each and every time .

The process I query like following :

root@bagpuss $ ps auxw|sort -r +3|head -10
USER PID %CPU %MEM SZ RSS TTY STAT STIME TIME COMMAND
sharon 1658958 0.1 9.0 218016 214804 - A Sep 13 38:16 db2agent (idle) 0
dpf 1036486 0.0 1.0 14376 14068 - A Sep 17 3:10 db2hmon 0
sharon 1822932 0.0 1.0 12196 11608 - A Sep 12 6:41 db2hmon 0
dpf 1011760 0.0 0.0 9264 9060 - A Sep 17 3:03 db2hmon 3
dpf 1532116 0.0 0.0 9264 9020 - A Sep 17 3:04 db2hmon 2
dpf 786672 0.0 0.0 9264 8984 - A Sep 17 3:02 db2hmon 5
dpf 1077470 0.0 0.0 9264 8968 - A Sep 17 3:03 db2hmon 1
dpf 1269798 0.0 0.0 9248 9044 - A Sep 17 2:50 db2hmon 4
db2inst1 454756 0.0 0.0 9012 7120 - A Jul 19 0:52 db2sysc 0


Now , I want to create a script which helps me to find out the IDLE process and Kill that process automatically using PID.

Would anybody help me to give a sample script to do it ?

I am grateful to you . Waiting for Kind reply ... ....
 
Old 11-18-2009, 09:26 AM   #2
timmeke
Senior Member
 
Registered: Nov 2005
Location: Belgium
Distribution: Red Hat, Fedora
Posts: 1,515

Rep: Reputation: 59
You mean you want to kill the process
Quote:
sharon 1658958 0.1 9.0 218016 214804 - A Sep 13 38:16 db2agent (idle) 0
How about grep'ping for the 'db2agent (idle)' string, then cutting out the PID
and call the kill command?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Script to kill process id farooqkadri Red Hat 13 10-01-2009 11:54 AM
bash `kill`: process 'B' silently dies; but process 'A' = `kill` spews back debris! GrapefruiTgirl Programming 9 06-23-2009 09:42 AM
Shell Script : Kill a running process when another process starts ashmew2 Linux - General 3 08-20-2008 03:47 AM
kill the process invoked from a shell script, when the script is killed kskkumar Linux - Software 8 05-23-2007 11:29 AM
kill process script adnanm Linux - Newbie 3 03-02-2007 12:30 PM


All times are GMT -5. The time now is 01:14 PM.

Main Menu
 
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration