Programming :: Kill Process More Than 3 Hours Old From Shell Command?

Nov 15, 2010

My server pretty often becomes full up php processes running which are not needed.Is there a way to search for and kill any php process that is more than 3 hours old? as I understand it, i need to use ps piped with awk. awk at the moment seems very complicated to me, do not how to start tackling it.

View 5 Replies


ADVERTISEMENT

Programming :: Process More Than 3 Hours Old From Shell Command?

Nov 14, 2010

My server pretty often becomes full up php processes running which are not needed. Is there a way to search for and kill any php process that is more than 3 hours old?

View 7 Replies View Related

Programming ::get The PID Of The Process Giving Kill Signal To A Process?

Nov 26, 2008

I tried googling but didn't get any answer for this.I have a process called "abc" and it is running with PID "123".I have a putty session opened with PID "999".I am giving kill -TERM 123 from putty session.My process "abc" before dying it should catch the PID of the terminal which provided TERM signal to it.Is there any way to find this out

View 2 Replies View Related

Red Hat / Fedora :: Command To Stop That File/process Or Is It Just Kill The Process To Stop The Process?

Nov 11, 2010

I've some file with .sh extensions that runs some softwares.Now,how do I stop running that filesI know we run the command ./start_tomcat.sh to start the apache.Is there any command to stop that file/process or is it just kill the process to stop the process

View 2 Replies View Related

Programming :: How To Kill Process Of Script

Aug 13, 2010

My script in /usr/bin displays the time on the console tty1 :

Quote:

if [ $(echo &>/dev/null > /dev/tty8; echo $?) -eq 0 ]
then
while [ 1 -lt 2 ]
do

[code].....

I'm started this script : /usr/bin/showtime How i can kill process of this script.

View 2 Replies View Related

Programming :: Kill More Than One Process In System?

Apr 27, 2010

I wanted to know how to kill more than one process in unix??
e.g- I have problem statement as
"Write a shell script to Kill all processes started from your login "

View 11 Replies View Related

General :: How To Tell The Kill Command To Ignore Processes If That Process Is Not Alive

Jun 18, 2010

How to tell the kill command to ignore processes if that process is not alive?

For example: 3453 is an alive process but 44534 is not.

kill -9 3453 44534

View 4 Replies View Related

Programming :: Displaying Process Id In Shell Script But There Is No Such Process?

Nov 9, 2010

I have a shell script to identify whether the process is running or not. If the process is not running, then I execute another script file to run my application. Below is my script and saved this script as monitorprocess.sh Code: #!/bin/bash

result=$(ps -ef | grep -v grep | grep "applicationname.sh" | awk '{print $2}')
echo $result
if [ "$result" == "" ];

[code]...

View 4 Replies View Related

Software :: Unable To Kill Process With Kill -9

Jan 13, 2011

the process is mcelog. When I do as root kill -9 2323 which is pid of mcelog the process is not killed. I tried doing the same from top, press K and enter pid of mcelog. doing ps auwx | grep mcelog I see there are several results. I tried killing all of them like kill -9 2355 2341 3425 2345. But re-running the above commands still shows them as running. How else would I troubleshoot this to avoid restarting of the box.

View 5 Replies View Related

Programming : Find Out Files That Are Changed Less Than 10 Hours With Grep Command?

Mar 20, 2010

Getting the list of files in the root directory that have changed less than 10 hours earlier, using grep, but without the directories.

View 1 Replies View Related

General :: Shell Command Equivalent To (Ctrl+C) To Exit From A Process?

Apr 1, 2011

I write a script to read a file which is something like a pipe (or) queue , which shows the running status.In normal case, if i open this file with cat command, i have to use ctrl+c to exit this . What command shall i use to do the same inside a shell script ? I have tried ^C in my script , but it does not exit the process.

View 6 Replies View Related

Programming :: Start A Process And Send Input To It In A Shell Script?

Jun 9, 2011

I'm building a Linux From Scratch system and partially automating it. I will likely want to do it again, and I would like to try to almost completely automate it.

My current approach is a script that takes an input file and sequentially runs each line in a new instance of bash. If one fails, it gives me the number of the step that failed so that I can use the "--step" option to resume after I fixed the issue.

This has some problems:
A varible created on one line will not be accessible on the next line. This is because each line is run in a separate shell (the reason for this is so that the commands in the input file and the script's internal variables can't interfere). You can't switch users or use chroot, again because each line is run in a separate shell.

What would be nice is to be able to start a bash process in the background and send commands to its stdin. I guess that a named pipe would work, but the named pipe will be gone after a chroot. Is there a way to do it without relying on the filesystem? Also, how do I know if the command failed?

View 14 Replies View Related

Programming :: Shell Script Ssh : Eliminate Login Process Output?

Jun 1, 2009

I use tcl-expect script to ssh to the server. How can I eliminate the first 2 lines if using system(./script.sh) to execute it, as the default output will be shown on shell and the first 2 lines are included.

Essentially I just want to have the "ps" result, not the login process. code...

View 1 Replies View Related

Programming :: Show The Output Of Shell Command Into A Textbox, Ex Ps -efc Command?

Oct 20, 2010

I am using gtk to program GUI. How can I show the output of shell command into a textbox, ex ps -efc command ?

View 3 Replies View Related

Programming :: Can Expect Return Control Of A Spawned Process To A Shell Script

Nov 19, 2009

Is it possible to have an Expect script spawn an SSH session, log in, then go into interactive mode and give control of the SSH session to a Bash script? Here's a simplified example of the script so far:

Code:
#!/bin/bash
expect -c "

[code]....

View 4 Replies View Related

General :: Automatically Restart A Process Every Few Hours?

Dec 30, 2010

I'm having a VPS using Ubuntu 10.4 and i would like a guide on how to restart apache2 process every few hours (a time determined by me).

View 11 Replies View Related

Debian Programming :: How To Use Shell Command

Sep 6, 2013

How to use shell command?

installs.sh:

Code: Select allapt-get install icedove-l10n-hu
apt-get install rar
apt-get install ...
...
y press key or other language is other key. hungarian key is: i

english after apt-get install in gnome-terminal: (y)es or (n)o
hungarian after apt-get install in gnome-terminal: (i)gen or (n)em

How to yes or no automatically in all languages? Not manual, not 'Y'/'I' or 'N'/'N' keydown.

I would like use this script my fresh installed Debian 7.1. I would like run this install.sh when Debian is installed for my all softwares when i would like use.

10 PC installing easy and faster my script.

If no script is slowly install for my 10 PC.

View 2 Replies View Related

Programming :: Detection Of A Command In Shell?

Apr 2, 2010

I would like to know if there is any way to detect a command if it going to be executed in the shell?

Eg:
Cmd: sudo apt-get clean I want a C program to be called before this cmd is executed.

View 8 Replies View Related

Programming :: Executing Shell Command In JSP

Aug 24, 2010

what we are trying to do is, to let the customer click a button in the web browser, and then the web server to call a shell script to do the work. The output from the stdout && stderr of the script should be displayed in the web browser once finished or timeout, along with the exit code of the script.

The shell script is however not on the web server, but on another app server. So to call this script from the web server as the identity 'tomcat':

Code:
$ sh appuser@app-server:$appbin/app-script

The .ssh/id_rsa.pub thing is done, and we have no problem doing this in the command line so far.

Our loaded ex-colleage has left us the webpages (jsp) with code like these:

Code:
<%@ include file="jsp_functions.jsp" %>
<%
String cmd = "sh $appbin/app-script";
ExecResult r = new ExecResult();

[Code].....

View 6 Replies View Related

Debian Multimedia :: Gnome-shell Slows Down After Few Hours Of Working

Aug 30, 2015

Why there is too much error in every version of gnome-shell and after everything slows down after a few hours of working in gnome-shell on debian(only on debian, i'm using gnome-shell in fedora and excellent experience i had in it) some of syslog output :

# tail -f /var/log/syslog
Aug 30 21:20:38 ali-deb gnome-session[8351]: (gnome-shell:8495): GLib-GObject-CRITICAL **: g_object_set: assertion 'G_IS_OBJECT (object)' failed
Aug 30 21:20:38 ali-deb gnome-session[8351]: (gnome-shell:8495): GLib-GObject-CRITICAL **: g_object_set: assertion 'G_IS_OBJECT (object)' failed
Aug 30 21:20:38 ali-deb gnome-session[8351]: (gnome-shell:8495): Clutter-CRITICAL **: clutter_layout_manager_get_child_meta: assertion 'CLUTTER_IS_LAYOUT_MANAGER (manager)' failed

[Code] .....

View 2 Replies View Related

Programming :: Using The Process Status (ps) Command In A Bash Script?

May 27, 2009

I am new to scripting and been working on this bash script for awhile now. I been researching this problem, but I can't seem to find a solution. I was wondering if someone could please help me out. Here is my script:

#!/bin/bash
NO="ps -ef | grep NO | grep -v grep"
NOWC=`ps -ef | grep NO | grep -v grep | wc -l`

[code].....

I cannot get this script to run the "ps -ef" command on the client. It get its value from the host machine that I am running this script from. I need this command to execute on the client. When I run the command (ps -ef | grep NO | grep -v grep) on the client, I get something back. Here is what I get when I try to debug the script.

XX# ./test_ps5.sh XXXXX
+ NO='ps -ef | grep NO | grep -v grep'
++ ps -ef

[code]....

View 5 Replies View Related

Programming :: Pass A Shell Variable To An AWK Command?

Dec 23, 2010

I have the following code :

Code:
E_BADARGS=65
if [ $# -ne 2 ] ; then

[code]...

View 1 Replies View Related

Debian :: Can't Kill Zombie Process

Feb 2, 2016

Sometimes (rarely) when I try to open VLC it wont open, but it stays in the background and takes 98-100% of one core.

The problem is that I can't kill that vlc-process.

Code: Select allkillall vlc
will NOT kill it
and
Code: Select allkill 31641
won't work either

top shows
Code: Select allPID       USER      PR  NI  VIRT        RES     SHR     S    %CPU   %MEM     TIME+     COMMAND
31641  xxxxxxxx   20   0   1320248   64384  39120   S   100.0         1.6     44:51.94     vlc

Is there any way to kill the vlc-process (without booting the machine)? I also tried the "killall vlc" and "kill 31641" as root with the same results.

I have Debian jessie and the only "nonofficial" repositories I have enabled are

#google chrome
http://dl.google.com/linux/chrome/deb stable main
#Backports
deb http://httpredir.debian.org/debian jessie-backports main

And from those I have installed only chrome, and wine-development, and I dont think those could have anything to do with this problem.

Booting the machine does work, but I don't want to boot my machine just now. This happens about once per week

View 4 Replies View Related

Debian :: Kill A Process Using GUI Interface?

Dec 31, 2010

well i am doing an assignment about debian OS 5 . so i need some info about Deadlocks and how to kill a process using GUI interface . i already found a way to do it in Command line .

View 3 Replies View Related

General :: Kill The Process In Different Group But Not One-by-one?

Apr 5, 2010

Can we just put all the processes in one group and kill that group? Is there any other way to do this?

View 3 Replies View Related

General :: How To Kill A Process With Name Having Spaces

Dec 10, 2010

A process with name=example can be killed by killall -9 example

How to kill multiple instances of following command which contain spaces?

"valgrind --tool=lackey ./testcases/kernel/syscalls/waitpid/waitpid03"

Following command returns valgrind --tool=lackey ./testcases/kernel/syscalls/waitpid/waitpid03: No such file or directory

View 3 Replies View Related

General :: What To Do When Ctrl-c Can't Kill Process?

Feb 9, 2011

Ctrl-c doesn't always work to kill the current process (for instance, if that process is busy in certain network operations). In that case, you just see "^C" by your cursor, and can't do much else.What's the easiest way to force that process to die now without losing my terminal?

Summary of answers below:Usually, you can Ctrl-z to put the process to sleep, and then do "kill -9 process-pid", where you find the process's pid with 'ps' and other tools.On Bash (and possibly other shells) you can do "kill -9 %1" (or '%N' in general) which is easier. If Ctrl-z doesn't work, you'll have to open another terminal and kill from there.

View 6 Replies View Related

General :: How To Kill Same Group Process

Feb 18, 2011

How to kill a process initiated by another user, who is in same group as me?

View 1 Replies View Related

Ubuntu :: How To Kill A Wine Process

Nov 7, 2010

How can I kill a specific wine process? for example paint shop pro has crashed under wine and will not close but how can I find the specific pid to kill it? ps axwww | grep wine shows the pid of wineserver and winedevice but it doesnt show the pid of the prgram I want to kill

5995 ? Ss 0:00 /usr/bin/wineserver
6001 ? Sl 0:00 C:windowssystem32winedevice.exe MountMgr
6054 pts/0 S+ 0:00 grep --color=auto wine

View 5 Replies View Related

Ubuntu :: Kill A Process - Jobs - Pd

Mar 28, 2011

I am learning terminal and i want to kill a process. There are 2 ways to do it i ve heard. 1st way is to type following in terminal:

[Code].....

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved