<?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 for Dormant Users in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/script-for-dormant-users/m-p/3468208#M211237</link>
    <description>hi kelly,&lt;BR /&gt;actually, ive done it via finger -sw, redirecting the output to a file, then manually sorting it out (whew!). now, i really wonder how can it be improved considering that i have about 5000 users per server.&lt;BR /&gt;&lt;BR /&gt;im thinking of the date... can we manipulate the date command (or its output) so that we could have it deducted for n days? all i viewed is the formatting output, w/c if ur goin to do it mathematically (date - 30), obviously gives the wrong value considering that day is not in decimal.&lt;BR /&gt;&lt;BR /&gt;i wonder if theres a script that could calculate current date minus n_dates..&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Fri, 21 Jan 2005 03:04:37 GMT</pubDate>
    <dc:creator>nibble</dc:creator>
    <dc:date>2005-01-21T03:04:37Z</dc:date>
    <item>
      <title>Script for Dormant Users</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-for-dormant-users/m-p/3468205#M211234</link>
      <description>guys, i need a script that will do the following:&lt;BR /&gt;&lt;BR /&gt;run the script on that day and it will generate the list of users who have not logon for the last n days (n maybe 30, 60)&lt;BR /&gt;&lt;BR /&gt;ive tried last, comm with /etc/passwd  but its so general for the Month only and doesnt care of the Year. &lt;BR /&gt;&lt;BR /&gt;i wonder if there are ways to calculate the last 30 days of todays date...then filtering em out login details..&lt;BR /&gt;&lt;BR /&gt;tnx..</description>
      <pubDate>Fri, 21 Jan 2005 02:43:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-for-dormant-users/m-p/3468205#M211234</guid>
      <dc:creator>nibble</dc:creator>
      <dc:date>2005-01-21T02:43:14Z</dc:date>
    </item>
    <item>
      <title>Re: Script for Dormant Users</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-for-dormant-users/m-p/3468206#M211235</link>
      <description>You're right about last (and finger for that matter).  The only thing I can suggest is looking at the timestamp on the users .sh_history file in their home directory (if they have one!).  Hope it helps, guess someone else will have a better idea.&lt;BR /&gt;&lt;BR /&gt;Keith</description>
      <pubDate>Fri, 21 Jan 2005 02:50:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-for-dormant-users/m-p/3468206#M211235</guid>
      <dc:creator>Keith Bryson</dc:creator>
      <dc:date>2005-01-21T02:50:30Z</dc:date>
    </item>
    <item>
      <title>Re: Script for Dormant Users</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-for-dormant-users/m-p/3468207#M211236</link>
      <description>You may want to try this if your users have the .sh_history file:&lt;BR /&gt;&lt;BR /&gt;for user in `ls -1 /home | grep -v "lost+found"`&lt;BR /&gt;do&lt;BR /&gt; if [ `find /home/$user -name .sh_history -mtime -30 | wc -l` = 1 ]&lt;BR /&gt; then&lt;BR /&gt;  echo "User $user has logged in during the last 30 days"&lt;BR /&gt; else&lt;BR /&gt;  echo "User $user has NOT logged in during the last 30 days"&lt;BR /&gt; fi&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;All the best - Keith</description>
      <pubDate>Fri, 21 Jan 2005 03:01:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-for-dormant-users/m-p/3468207#M211236</guid>
      <dc:creator>Keith Bryson</dc:creator>
      <dc:date>2005-01-21T03:01:51Z</dc:date>
    </item>
    <item>
      <title>Re: Script for Dormant Users</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-for-dormant-users/m-p/3468208#M211237</link>
      <description>hi kelly,&lt;BR /&gt;actually, ive done it via finger -sw, redirecting the output to a file, then manually sorting it out (whew!). now, i really wonder how can it be improved considering that i have about 5000 users per server.&lt;BR /&gt;&lt;BR /&gt;im thinking of the date... can we manipulate the date command (or its output) so that we could have it deducted for n days? all i viewed is the formatting output, w/c if ur goin to do it mathematically (date - 30), obviously gives the wrong value considering that day is not in decimal.&lt;BR /&gt;&lt;BR /&gt;i wonder if theres a script that could calculate current date minus n_dates..&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 21 Jan 2005 03:04:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-for-dormant-users/m-p/3468208#M211237</guid>
      <dc:creator>nibble</dc:creator>
      <dc:date>2005-01-21T03:04:37Z</dc:date>
    </item>
    <item>
      <title>Re: Script for Dormant Users</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-for-dormant-users/m-p/3468209#M211238</link>
      <description>that's a nice way of checking it out K, but cant be applied since my users are in once generic home directory and dont have any history files. so i could only rely to finger or last</description>
      <pubDate>Fri, 21 Jan 2005 03:08:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-for-dormant-users/m-p/3468209#M211238</guid>
      <dc:creator>nibble</dc:creator>
      <dc:date>2005-01-21T03:08:56Z</dc:date>
    </item>
    <item>
      <title>Re: Script for Dormant Users</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-for-dormant-users/m-p/3468210#M211239</link>
      <description>Hello nibble,&lt;BR /&gt;&lt;BR /&gt;The solution with a find on the .sh_history file can still work if you change the name of the history file to include the userid, like:&lt;BR /&gt;&lt;BR /&gt;export HISTFILE=~/histories/.sh_hist.$LOGNAME&lt;BR /&gt;&lt;BR /&gt;to keep history files small use&lt;BR /&gt;&lt;BR /&gt;export HISTSIZE=100&lt;BR /&gt;&lt;BR /&gt;This means you will collect some 5000 history files in the 'histories' directory, but that should not be a problem.&lt;BR /&gt;&lt;BR /&gt;HTH&lt;BR /&gt;Timo</description>
      <pubDate>Fri, 21 Jan 2005 04:11:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-for-dormant-users/m-p/3468210#M211239</guid>
      <dc:creator>Timo Ruiter</dc:creator>
      <dc:date>2005-01-21T04:11:10Z</dc:date>
    </item>
    <item>
      <title>Re: Script for Dormant Users</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-for-dormant-users/m-p/3468211#M211240</link>
      <description>If you have perl installed you could use the following to print the date 30 days ago. (Note 86400 is the number of seconds in a day)&lt;BR /&gt;&lt;BR /&gt;# perl -e 'print scalar localtime(time - (30 * 86400))'&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 21 Jan 2005 04:53:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-for-dormant-users/m-p/3468211#M211240</guid>
      <dc:creator>Stephen Keane</dc:creator>
      <dc:date>2005-01-21T04:53:58Z</dc:date>
    </item>
    <item>
      <title>Re: Script for Dormant Users</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-for-dormant-users/m-p/3468212#M211241</link>
      <description>Hi,&lt;BR /&gt;attached my script:&lt;BR /&gt;I have tested it on one of our servers and it works!&lt;BR /&gt;Regards</description>
      <pubDate>Fri, 21 Jan 2005 05:47:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-for-dormant-users/m-p/3468212#M211241</guid>
      <dc:creator>Peter Godron</dc:creator>
      <dc:date>2005-01-21T05:47:59Z</dc:date>
    </item>
    <item>
      <title>Re: Script for Dormant Users</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-for-dormant-users/m-p/3468213#M211242</link>
      <description>Nibble,&lt;BR /&gt;have you had a look at my script?&lt;BR /&gt;IS this problem still open, or can the thread be closed?&lt;BR /&gt;Regards</description>
      <pubDate>Mon, 24 Jan 2005 09:18:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-for-dormant-users/m-p/3468213#M211242</guid>
      <dc:creator>Peter Godron</dc:creator>
      <dc:date>2005-01-24T09:18:10Z</dc:date>
    </item>
    <item>
      <title>Re: Script for Dormant Users</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-for-dormant-users/m-p/3468214#M211243</link>
      <description>Using the 'finger' command is a good isea, unless you have security concerns and have the 'finger' turned off. &lt;BR /&gt;&lt;BR /&gt;I use the 'last' command and it variations. I keep a wtmp file for some 90 days, if a user does not show up in the last output then I know that user has not logged in for the last 90 days.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 24 Jan 2005 11:36:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-for-dormant-users/m-p/3468214#M211243</guid>
      <dc:creator>Rick Garland</dc:creator>
      <dc:date>2005-01-24T11:36:33Z</dc:date>
    </item>
    <item>
      <title>Re: Script for Dormant Users</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-for-dormant-users/m-p/3468215#M211244</link>
      <description>tnx everyone...the script helped a lot. i think il hav it modify to fit my requirement.&lt;BR /&gt;&lt;BR /&gt;we may close this thread now.&lt;BR /&gt;&lt;BR /&gt;matsalams!</description>
      <pubDate>Mon, 24 Jan 2005 19:19:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-for-dormant-users/m-p/3468215#M211244</guid>
      <dc:creator>nibble</dc:creator>
      <dc:date>2005-01-24T19:19:19Z</dc:date>
    </item>
  </channel>
</rss>

