Sponsored Content
Top Forums Shell Programming and Scripting Quick question about finding the PID of long-running processes Post 302672627 by Bolanok on Monday 16th of July 2012 04:41:17 PM
Old 07-16-2012
Quick question about finding the PID of long-running processes

The end result that I'd like is to terminate any process on my ps -u username list that extends beyond 20 minutes. I know for a fact that this process will be named l[0-999].exe, but I don't know the number in between and I won't know the PID. Is there a way to use grep or pidof to do this task every 20 minutes or so?

Thanks!
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Controlling processes knowing the PID's

Dear all, suppose that I start a process (named "father"). "father" starts in turns a process called "child" with an execv call (after a fork). In this way "father" will be notified if "chlid" crashes (SIGCHILD mechanism). The problem is: if "father" crashes, how can I do to be recreate a... (1 Reply)
Discussion started by: npalmentieri
1 Replies

2. Shell Programming and Scripting

long runnning processes more than one hour not able to see in ps -ef command

hi, We have one script ‘X' which invokes another script ‘Y'. Inside X we are checking if Y is active/running or not with ps command. But for cases when Y runs for more than 1 hour the ps command inside X returns that no Y process running. Can you please guide me if in UNIX any long running process... (4 Replies)
Discussion started by: shyam soni
4 Replies

3. UNIX for Dummies Questions & Answers

Quick question about finding a large file

what is the correct command for finding the largest file and displaying it without any error information? I can find it, but how do I display it in the same command? (6 Replies)
Discussion started by: raidkridley
6 Replies

4. Shell Programming and Scripting

Finding the nice(ni) number with PID?

Hi, is there a command that takes the PID of a process and that only diplays it's ni number? I`m pretty sure it would require pipes but I tried a few things that ended up miserably... Since the ps command doesn't show the ni unless I do ps -o ni but then I can't find a way to search the right... (2 Replies)
Discussion started by: Yakuzan
2 Replies

5. Shell Programming and Scripting

Script for long running processes....

I searched the forums but didn't see anything related to what I'm looking for. I need a script that would give me a listing of jobs running longer than, for example, 12 hours or so. Thanks in advance for your assistance!! (2 Replies)
Discussion started by: CyberOptiq
2 Replies

6. UNIX for Dummies Questions & Answers

Run Processes Sequentially Using Process ID (PID)

Hi, I'm a newbie when it comes to using UNIX, and I'm hoping someone here can help me out. I have a set of processes that I want to run sequentially: process1.py process2.py process3.py I want to know I can run these sequentially using their process IDs (PIDs). Ideally, I want to... (2 Replies)
Discussion started by: shelata
2 Replies

7. Shell Programming and Scripting

Finding the age of a unix process, killing old processes, killing zombie processes

I had issues with processes locking up. This script checks for processes and kills them if they are older than a certain time. Its uses some functions you'll need to define or remove, like slog() which I use for logging, and is_running() which checks if this script is already running so you can... (0 Replies)
Discussion started by: sukerman
0 Replies

8. Shell Programming and Scripting

determine the active processes on the system which are running since long time

Hi , Please help me shell script to determine the active processes on the system which are running since long time (2 Replies)
Discussion started by: itian2010
2 Replies

9. AIX

How to Identify long running unix processes

Hi All, Need an urgent help, I have a requirement to find long running unix processes.. I have tried the below commands, but not succeed. I need to arrange the unix processess in an order of elapsed time (high to low) that runs in a system. For Eg: Consider we have 3 processes, Pid 1 pid 2... (5 Replies)
Discussion started by: mohamedirfan
5 Replies

10. AIX

Need to check long running processes on the database server and the os is AIX

Hello, Please help me with a script with which I can check long running processes on the database server and the os is AIX. Best regards, Vishal (5 Replies)
Discussion started by: Vishal_dba
5 Replies
PIDOF(8)						Linux System Administrator's Manual						  PIDOF(8)

NAME
pidof -- find the process ID of a running program. SYNOPSIS
pidof [-s] [-c] [-n] [-x] [-o omitpid[,omitpid..]] [-o omitpid[,omitpid..]..] program [program..] DESCRIPTION
Pidof finds the process id's (pids) of the named programs. It prints those id's on the standard output. This program is on some systems used in run-level change scripts, especially when the system has a System-V like rc structure. In that case these scripts are located in /etc/rc?.d, where ? is the runlevel. If the system has a start-stop-daemon (8) program that should be used instead. OPTIONS
-s Single shot - this instructs the program to only return one pid. -c Only return process ids that are running with the same root directory. This option is ignored for non-root users, as they will be unable to check the current root directory of processes they do not own. -n Avoid stat(2) system function call on all binaries which are located on network based file systems like NFS. Instead of using this option the the variable PIDOF_NETFS may be set and exported. -x Scripts too - this causes the program to also return process id's of shells running the named scripts. -o omitpid Tells pidof to omit processes with that process id. The special pid %PPID can be used to name the parent process of the pidof pro- gram, in other words the calling shell or shell script. EXIT STATUS
0 At least one program was found with the requested name. 1 No program was found with the requested name. NOTES
pidof is actually the same program as killall5; the program behaves according to the name under which it is called. When pidof is invoked with a full pathname to the program it should find the pid of, it is reasonably safe. Otherwise it is possible that it returns pids of running programs that happen to have the same name as the program you're after but are actually other programs. Note that that the executable name of running processes is calculated with readlink(2), so symbolic links to executables will also match. SEE ALSO
shutdown(8), init(8), halt(8), reboot(8), killall5(8) AUTHOR
Miquel van Smoorenburg, miquels@cistron.nl 01 Sep 1998 PIDOF(8)
All times are GMT -4. The time now is 04:14 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy