- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- check the process
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-26-2005 10:40 PM
09-26-2005 10:40 PM
check the process
eg. the start time of the below process are 15:19 / 15:20 , but I don't know the exact time ( in term of "second" ) it start to run ( I only know the hour and minute ) , if I want to find which of these jobs that it has started to run over 30 seconds ( it should be 8212 , 8215 , 8221 ) , what can I do ? thx
#ps -ef |grep ora
root 8212 1 0 15:19 ? 00:00:00 ora
root 8215 1 0 15:20 ? 00:00:00 ora
root 8221 1 0 15:20 ? 00:00:00 ora
root 8224 1 0 15:20 ? 00:00:00 ora
#date
Mon Sep 26 15:20:35 CST 2005
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-26-2005 10:57 PM
09-26-2005 10:57 PM
Re: check the process
If etime (the format seems to be MM:SS) is greater than 30 secs, you can do what you want.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-26-2005 11:30 PM
09-26-2005 11:30 PM
Re: check the process
# UNIX95= ps -eo comm,pid,etime | awk '{ split($3,a,":"); time=a[1]*60 + a[2]; if ( time > 30 ) { print $2" is running more than 30 seconds" }}'
hth.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2005 02:46 AM
09-27-2005 02:46 AM
Re: check the process
If I want to merge the above condition with the script you provide , could suggest how to change it ? thx
#!/bin/ksh
# unuse.ksh
# Time to Sleep - 60 seconds / 10 times = 6 second
stime=6
while [ 1 ]
do
for pid in `ps -ef | grep -i 'ora' | awk '!/COMMAND/ { if ( $3 != "2" ) { print $2; }} '`
do
kill -9 $pid
[ $? -eq 0 ] && echo "pid is killed" || echo "pid is not killed" >> /tmp/pid.log
done
sleep $stime
done
# end
# chmod +x unuse.ksh
# ./unuse.ksh &
# tail -f /tmp/pid.log
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-28-2005 01:10 AM
09-28-2005 01:10 AM