- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Re: Determining the elapsed time for a process - e...
Operating System - Linux
1822909
Members
3921
Online
109645
Solutions
Forums
Categories
Company
Local Language
back
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
back
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
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- 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
10-08-2002 03:21 AM
10-08-2002 03:21 AM
Determining the elapsed time for a process - etime
I am trying to write a very simply script taht simply check if a process has been running for more than an hour and then kills it. With the complications of the 24 hour clock I was hoping there was a simply ps option that simply gave me elapsed time. In the man page there does appear to be an option of etime, however I am unable to get this to work has anyone got any ideas.
1 REPLY 1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-08-2002 05:21 PM
10-08-2002 05:21 PM
Re: Determining the elapsed time for a process - etime
ps -eo etime=,pid= | awk -F':' '{if (NF > 2) { system( "kill -TERM " $2 )}'
... a bit indiscriminate ... You might want to do checks for a given process etc. etc., but, that's the basics.
Hope it helps!
NOTE: The 'ps' man page gives you lots of options of how you want the output of PS to look. Using the '-o' operator, you supply a comma-separated list of the fields you want. Using the '=' after it means "don't print the title of this field"
... a bit indiscriminate ... You might want to do checks for a given process etc. etc., but, that's the basics.
Hope it helps!
NOTE: The 'ps' man page gives you lots of options of how you want the output of PS to look. Using the '-o' operator, you supply a comma-separated list of the fields you want. Using the '=' after it means "don't print the title of this field"
One long-haired git at your service...
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Learn About
News and Events
Support
© Copyright 2025 Hewlett Packard Enterprise Development LP