<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Determining the elapsed time for a process - etime in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/determining-the-elapsed-time-for-a-process-etime/m-p/2820795#M2682</link>
    <description>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.</description>
    <pubDate>Tue, 08 Oct 2002 10:21:25 GMT</pubDate>
    <dc:creator>Adam Noble</dc:creator>
    <dc:date>2002-10-08T10:21:25Z</dc:date>
    <item>
      <title>Determining the elapsed time for a process - etime</title>
      <link>https://community.hpe.com/t5/operating-system-linux/determining-the-elapsed-time-for-a-process-etime/m-p/2820795#M2682</link>
      <description>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.</description>
      <pubDate>Tue, 08 Oct 2002 10:21:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/determining-the-elapsed-time-for-a-process-etime/m-p/2820795#M2682</guid>
      <dc:creator>Adam Noble</dc:creator>
      <dc:date>2002-10-08T10:21:25Z</dc:date>
    </item>
    <item>
      <title>Re: Determining the elapsed time for a process - etime</title>
      <link>https://community.hpe.com/t5/operating-system-linux/determining-the-elapsed-time-for-a-process-etime/m-p/2820796#M2683</link>
      <description>ps -eo etime=,pid= | awk -F':' '{if (NF &amp;gt; 2) { system( "kill -TERM " $2 )}'&lt;BR /&gt;&lt;BR /&gt;...  a bit indiscriminate ... You might want to do checks for a given process etc. etc., but, that's the basics.&lt;BR /&gt;&lt;BR /&gt;Hope it helps!&lt;BR /&gt;&lt;BR /&gt;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"</description>
      <pubDate>Wed, 09 Oct 2002 00:21:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/determining-the-elapsed-time-for-a-process-etime/m-p/2820796#M2683</guid>
      <dc:creator>Stuart Browne</dc:creator>
      <dc:date>2002-10-09T00:21:02Z</dc:date>
    </item>
  </channel>
</rss>

