Hi, I need a script that can automatically kill all processes named "webrepn" and "webrebw" if idle for more than 30 minutes.
Then I will have a Cron Job to run the script every night or 2-3 times a day depends on how this script helps.
Right now, I run "ps -ef | grep webrebn" and "kill -9 PID" to kill the idle processes using PID if I see any. Then repeat for "webrepw". The problem is if I forget to do so for couple days, my system will be very slow. Would anybody help me out here?
If you want to kill suspect_process if TIME > 30 minutes, I would do the following:
I don't have the scenario to test this correctly.
TIME on my computer is like 00:00:00 - I cut the middle columns assuming that's the minutes.
STIME would be more awkward to use. On my computer it says something like Mar22. You could certainly use that kind of data, but it's going to be awkward dealing with new month, etc.
If the process is idle, why does it make the computer slow?
I should not use the word "IDLE" then. Normally, our online reports have 30 min time out. However, if the user closed/exit our online report menu improperly, then the process will still running for days even weeks. When more and more of this kind of processes running, our system will slow down.
If I run "ps auxw | grep webrepn", I get this:
Look at under %CPU, 10% for each one, it really will slow down the system.
So two things I need here, 1) to find out the pid of those process, 2) kill them.
Any thoughts?
Last edited by Franklin52; 03-26-2013 at 04:03 AM..
Reason: Please use code tags for data and code samples
Hi Team ,
I have one process named as cec_analysiseool that is running on unix box machine now i want to kill this process so please advise what will be the ideal command to kill this , what i have tried is :confused:
kill -9 `ps -ef | grep cec_analysiseool | grep -v grep | awk '{print $2}'` (2 Replies)
What I need to learn is how to use a script that launches background processes, and then kills those processes as needed.
The script successfully launches the script. But how do I check to see if the job exists before I kill it?
I know my problem is mostly failure to understand parameter... (4 Replies)
Hi All,I have a problem with my kill idle script.my script is supposed to kill the user sessions which are idle for more than 2 hours.But is is killing the sessions which are idle for less than 2 hrs also.I dont know the exact time after which the script is killing,but it is less than 2 hours i am... (3 Replies)
Hi Experts, we do have a shell script for Unix Solaris, which will kill all the process manullay, it used to work in my previous env, but now it is throwing this error.. could some one please help me to resolve it
This is how we execute the script (and this is the requirement) ... (2 Replies)
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 ... (3 Replies)
Hi,
In my network we uses the NetTerm program to connect us to HP-UX 10.x server from windows workstations, but in some cases the user doesn't logout and close it by window's x button. The problem is that in HP-UX the user and all his tasks remain active and when he enter again HP-UX creates a... (12 Replies)
My max user parm is set to 1050. I'm currently at 1038 this is causing major slow downs on the server. I looking for a way log off "idle" user logins with out having to do it individually. :confused: (5 Replies)
Hi,
Please let us know of any possiblity of identifying and killing unix proces invoked externally (by an external tool which does not create a session). 'who' command gives idle time of sessions. But what we are looking for is idle time of a process. 'ps' command gives the elapsed/running... (1 Reply)