04-06-2004
do it in a loop?
while true
do
ps -aux | grep rpm | grep -v grep
sleep 1
done
Thats a basic idea, but you can elaborate with logging to a file for example.
10 More Discussions You Might Find Interesting
1. HP-UX
Hi
I have a doubt regarding process states in HP unix system. Is there a way to check whether a process is hanged or still actively running? I have few scripts which run for a long time. but sometimes these are getting hanged. But i'm never sure whether they are running or waiting in kind of... (4 Replies)
Discussion started by: truth
4 Replies
2. UNIX for Advanced & Expert Users
Can we run a script in nohup which calls another script in nohup.
eg
Script1.sh
#Script1 start
nohup script2.sh
.
.
.
#end script1.sh
Now can I do this
nohup script1.sh
Also is all scheduled processes (crontab entries) will run as nohup?
Would appreciate if any one can... (3 Replies)
Discussion started by: yakyaj
3 Replies
3. UNIX for Dummies Questions & Answers
how to identify the processes running by giving the parent process id (1 Reply)
Discussion started by: trichyselva
1 Replies
4. Shell Programming and Scripting
I'm doing a script with the Shell. I need that it only show the number of running processes.
Ex:
echo "There are `command` running processes"
Thnx!
Pd: Sorry the idiom. I'm spanish. (2 Replies)
Discussion started by: Ikebana
2 Replies
5. Shell Programming and Scripting
Hi can anybody help me regarding this..
i want know the output of ps -ef with explanation.
how can we know the running processess.
this is the output of ps -elf
F S UID PID PPID C PRI NI ADDR SZ WCHAN STIME TTY TIME CMD
19 T root 0 0 0 0 SY ... (1 Reply)
Discussion started by: rajesh_pola
1 Replies
6. Solaris
Hi guys just a question is it normal to see running process on a non-global zone in the global zone... processes such as cron. (3 Replies)
Discussion started by: batas
3 Replies
7. Linux
Hi guys is it normal to have 5-10 cron/syslog processes running... in my case i got 10 cron process running. (4 Replies)
Discussion started by: batas
4 Replies
8. Solaris
Hi All!
I am trying to get sendmail to work but unsuccessfull...when I run ps -ef | grep sendmail
root 10578 10561 0 11:01:24 pts/1 0:00 grep sendmail
I do not see its processes
When I run the following commands:
bash-3.00# svcs sendmail
svcs: Pattern 'sendmail' doesn't match... (9 Replies)
Discussion started by: fretagi
9 Replies
9. Shell Programming and Scripting
I want to check how many processes are running with same names and get their respective counts.
ps -ef|grep -Eo 'process1|process2|process3| '|sort -u | awk '{print $2": "$1}'
Output would look like :
$ ps -ef|grep -Eo 'process1|process2|process3| '|sort | uniq -c | awk '{print $2":... (8 Replies)
Discussion started by: simpltyansh
8 Replies
10. UNIX for Beginners Questions & Answers
Hello everybody ,
I launched cron to execute a task every hour but the job takes more than hour that's why I'm getting more than 1000 cron processes running at the same time !!!
My question is how to tell cron not to execute unless the job terminated in order to have only one process running .... (14 Replies)
Discussion started by: beautymind
14 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)