<?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 Re: Script Help in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/2529792#M868237</link>
    <description>Just a note for everyone:&lt;BR /&gt;&lt;BR /&gt;NEVER use kill -9&lt;BR /&gt;&lt;BR /&gt;When you use kill -9 you guarentee that the processes you kill will not terminate properly. Datafiles may have incomplete records, databases can have broken chains and indexes, LAN ports will be left open and so on. Always use kill -15 for idle sessions ... but be very careful you are terminating an idle shell and not a process that may require hours to rerun.  In a good script, you should test that kill -15 worked (PID is gone) and if not then resort to kill -9 but be sure to email root that you had to do this.&lt;BR /&gt;&lt;BR /&gt;For truly idle shells, you can set the TMOUT env value (or autologout for csh) in /etc/profile to automatically logout the users.  It is ALWAYS recommended to set root's TMOUT value, about an hour or so.  There is never a reason to leave any root session idle for a long time - unless security is unimportant.</description>
    <pubDate>Fri, 18 May 2001 00:27:49 GMT</pubDate>
    <dc:creator>Bill Hassell</dc:creator>
    <dc:date>2001-05-18T00:27:49Z</dc:date>
    <item>
      <title>Script Help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/2529789#M868234</link>
      <description>Hello Everyone,&lt;BR /&gt;&lt;BR /&gt;I have an idea for a script and I am looking for help/suggestions and whether it is possible to do this.  Is it possible to use the output of who -u to log people off if their idle time is greater than a certain value?  I have an idea of how it could be done but my scripting abilities are not so great.  Any help would be appreciated.  Thank you so very much.&lt;BR /&gt;&lt;BR /&gt;Peter</description>
      <pubDate>Thu, 17 May 2001 16:49:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/2529789#M868234</guid>
      <dc:creator>Peter Maitland</dc:creator>
      <dc:date>2001-05-17T16:49:30Z</dc:date>
    </item>
    <item>
      <title>Re: Script Help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/2529790#M868235</link>
      <description>Hi Peter &lt;BR /&gt;&lt;BR /&gt;Try this&lt;BR /&gt;&lt;BR /&gt;who -u | awk '{if ($6 &amp;gt; "1" ) print $7 }' &amp;gt; /tmp/processid&lt;BR /&gt;for i in 'cat /tmp/processid '&lt;BR /&gt;do&lt;BR /&gt;kill -9 $i&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;This will kill the login of all user who are logged in for more than a hour , change "1" in the script for better range.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Manoj Srivastava</description>
      <pubDate>Thu, 17 May 2001 17:10:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/2529790#M868235</guid>
      <dc:creator>MANOJ SRIVASTAVA</dc:creator>
      <dc:date>2001-05-17T17:10:02Z</dc:date>
    </item>
    <item>
      <title>Re: Script Help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/2529791#M868236</link>
      <description>Hello Peter&lt;BR /&gt;&lt;BR /&gt;Try this script, be careful, don?t kill your job&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/ksh                                                          &lt;BR /&gt;#########################################################               &lt;BR /&gt;#                                                                       &lt;BR /&gt;#       Kill Sleepers Script    (Run me each half hour)                 &lt;BR /&gt;#                                                                       &lt;BR /&gt;#########################################################               &lt;BR /&gt;TMOUT="0:30"                            # Replace with time to out HH:MM&lt;BR /&gt;SLPRS=`who -u | awk '{ if ($6 &amp;gt; $TMOUT) print $7 }'`                    &lt;BR /&gt;kill -9 $SLPRS                                                          &lt;BR /&gt;                                                                       &lt;BR /&gt;</description>
      <pubDate>Thu, 17 May 2001 17:32:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/2529791#M868236</guid>
      <dc:creator>Juan José Muñoz</dc:creator>
      <dc:date>2001-05-17T17:32:57Z</dc:date>
    </item>
    <item>
      <title>Re: Script Help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/2529792#M868237</link>
      <description>Just a note for everyone:&lt;BR /&gt;&lt;BR /&gt;NEVER use kill -9&lt;BR /&gt;&lt;BR /&gt;When you use kill -9 you guarentee that the processes you kill will not terminate properly. Datafiles may have incomplete records, databases can have broken chains and indexes, LAN ports will be left open and so on. Always use kill -15 for idle sessions ... but be very careful you are terminating an idle shell and not a process that may require hours to rerun.  In a good script, you should test that kill -15 worked (PID is gone) and if not then resort to kill -9 but be sure to email root that you had to do this.&lt;BR /&gt;&lt;BR /&gt;For truly idle shells, you can set the TMOUT env value (or autologout for csh) in /etc/profile to automatically logout the users.  It is ALWAYS recommended to set root's TMOUT value, about an hour or so.  There is never a reason to leave any root session idle for a long time - unless security is unimportant.</description>
      <pubDate>Fri, 18 May 2001 00:27:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/2529792#M868237</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2001-05-18T00:27:49Z</dc:date>
    </item>
  </channel>
</rss>

