<?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: clear the wtmp file in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/clear-the-wtmp-file/m-p/3138988#M154802</link>
    <description>Hi,&lt;BR /&gt;&lt;BR /&gt;you also can do it with&lt;BR /&gt;cp /dev/null /var/adm/wtmp&lt;BR /&gt;&lt;BR /&gt;greetings,&lt;BR /&gt;&lt;BR /&gt;Michael&lt;BR /&gt;</description>
    <pubDate>Mon, 08 Dec 2003 14:24:22 GMT</pubDate>
    <dc:creator>Michael Schulte zur Sur</dc:creator>
    <dc:date>2003-12-08T14:24:22Z</dc:date>
    <item>
      <title>clear the wtmp file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/clear-the-wtmp-file/m-p/3138985#M154799</link>
      <description>How would I go about clearing the wtmp file?&lt;BR /&gt;&lt;BR /&gt;When I do a last|more it is quite huge, and this machine is not in production yet, so I would like to clear it out, and at least keep the first time the system was brought up.&lt;BR /&gt;&lt;BR /&gt;Is there a file to change?</description>
      <pubDate>Mon, 08 Dec 2003 14:15:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/clear-the-wtmp-file/m-p/3138985#M154799</guid>
      <dc:creator>Ratzie</dc:creator>
      <dc:date>2003-12-08T14:15:30Z</dc:date>
    </item>
    <item>
      <title>Re: clear the wtmp file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/clear-the-wtmp-file/m-p/3138986#M154800</link>
      <description>&amp;gt;wtmp&lt;BR /&gt;&lt;BR /&gt;is what you need ...&lt;BR /&gt;&lt;BR /&gt;-Karthik S S</description>
      <pubDate>Mon, 08 Dec 2003 14:16:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/clear-the-wtmp-file/m-p/3138986#M154800</guid>
      <dc:creator>Karthik S S</dc:creator>
      <dc:date>2003-12-08T14:16:22Z</dc:date>
    </item>
    <item>
      <title>Re: clear the wtmp file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/clear-the-wtmp-file/m-p/3138987#M154801</link>
      <description>I think you can do this:&lt;BR /&gt;&lt;BR /&gt;cat /dev/null &amp;gt; /var/adm/wtmp&lt;BR /&gt;&lt;BR /&gt;Rgds...Geoff</description>
      <pubDate>Mon, 08 Dec 2003 14:19:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/clear-the-wtmp-file/m-p/3138987#M154801</guid>
      <dc:creator>Geoff Wild</dc:creator>
      <dc:date>2003-12-08T14:19:51Z</dc:date>
    </item>
    <item>
      <title>Re: clear the wtmp file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/clear-the-wtmp-file/m-p/3138988#M154802</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;you also can do it with&lt;BR /&gt;cp /dev/null /var/adm/wtmp&lt;BR /&gt;&lt;BR /&gt;greetings,&lt;BR /&gt;&lt;BR /&gt;Michael&lt;BR /&gt;</description>
      <pubDate>Mon, 08 Dec 2003 14:24:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/clear-the-wtmp-file/m-p/3138988#M154802</guid>
      <dc:creator>Michael Schulte zur Sur</dc:creator>
      <dc:date>2003-12-08T14:24:22Z</dc:date>
    </item>
    <item>
      <title>Re: clear the wtmp file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/clear-the-wtmp-file/m-p/3138989#M154803</link>
      <description>&amp;gt; /var/adm/wtmp&lt;BR /&gt;cat /dev/null &amp;gt; /var/adm/wtmp&lt;BR /&gt;&lt;BR /&gt;But do you have any issues with that? Is who reporting wrong details etc?&lt;BR /&gt;&lt;BR /&gt;Then I would advise you to check wtmp patches.&lt;BR /&gt;&lt;BR /&gt;Also have a look at fwtmp command. With command you can check wtmp file and fix it.</description>
      <pubDate>Mon, 08 Dec 2003 14:28:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/clear-the-wtmp-file/m-p/3138989#M154803</guid>
      <dc:creator>RAC_1</dc:creator>
      <dc:date>2003-12-08T14:28:15Z</dc:date>
    </item>
    <item>
      <title>Re: clear the wtmp file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/clear-the-wtmp-file/m-p/3138990#M154804</link>
      <description>You can make these type of routine maintenance tasks through SAM. Instead of nullyfying the entire wtmp file, you can easily "trim" your log files including wtmp file. This is a good way of maintining system log files.&lt;BR /&gt;&lt;BR /&gt;# sam -&amp;gt; Routine Tasks -&amp;gt;</description>
      <pubDate>Mon, 08 Dec 2003 14:35:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/clear-the-wtmp-file/m-p/3138990#M154804</guid>
      <dc:creator>Helen French</dc:creator>
      <dc:date>2003-12-08T14:35:57Z</dc:date>
    </item>
    <item>
      <title>Re: clear the wtmp file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/clear-the-wtmp-file/m-p/3138991#M154805</link>
      <description>The best and easiset way is to use SAM:&lt;BR /&gt;- administration&lt;BR /&gt;- log files&lt;BR /&gt;Trim it to the selected amount.</description>
      <pubDate>Mon, 08 Dec 2003 15:36:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/clear-the-wtmp-file/m-p/3138991#M154805</guid>
      <dc:creator>Jeff Ohlhausen</dc:creator>
      <dc:date>2003-12-08T15:36:57Z</dc:date>
    </item>
    <item>
      <title>Re: clear the wtmp file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/clear-the-wtmp-file/m-p/3138992#M154806</link>
      <description>SAM does not work on AIX :}&lt;BR /&gt;&lt;BR /&gt;--8&amp;lt;--- Script to reduce wtmp file to sensible size&lt;BR /&gt;#!/opt/perl/bin/perl&lt;BR /&gt;&lt;BR /&gt;use strict;&lt;BR /&gt;use warnings;&lt;BR /&gt;use User::Utmp;&lt;BR /&gt;&lt;BR /&gt;my ($n, $s, $treshold, @wtmp, %type) = (0, 0, time - 7 * 24 * 60 * 60); # One week should do&lt;BR /&gt;User::Utmp::utmpname (shift || "wtmp");&lt;BR /&gt;User::Utmp::setutent ();&lt;BR /&gt;while (my @entry = User::Utmp::getut1 ()) {&lt;BR /&gt;    ++$n % 100 or printf STDERR " %6d %6d\r", $n, $s;&lt;BR /&gt;    if ( $entry[0]-&amp;gt;{ut_type} == LOGIN_PROCESS &amp;amp;&amp;amp;&lt;BR /&gt;         $entry[0]-&amp;gt;{ut_time} &amp;gt; 0 &amp;amp;&amp;amp; $entry[0]-&amp;gt;{ut_time} &amp;lt; $treshold) {&lt;BR /&gt;        $s++;&lt;BR /&gt;        next;&lt;BR /&gt;        }&lt;BR /&gt;    push @wtmp, @entry;&lt;BR /&gt;    }&lt;BR /&gt;User::Utmp::endutent ();&lt;BR /&gt;&lt;BR /&gt; print STDERR "wtmp has $n entries, I skipped $s\n";&lt;BR /&gt;#print STDERR "[ ", (join ", ", map { "$_ =&amp;gt; $type{$_}" } sort { $a &amp;lt;=&amp;gt; $b } keys %type), " ]\n";&lt;BR /&gt;&lt;BR /&gt;User::Utmp::utmpname ("/tmp/wtmp");&lt;BR /&gt;User::Utmp::putut ($_) for @wtmp;&lt;BR /&gt;User::Utmp::endutent ();&lt;BR /&gt;--&amp;gt;8---&lt;BR /&gt;&lt;BR /&gt;i2:/var/adm 126 # clrwtmp.pl&lt;BR /&gt;wtmp has 359424 entries, I skipped 358595&lt;BR /&gt;i2:/var/adm 127 # ll wtmp /tmp/wtmp&lt;BR /&gt;    263 -rw-r--r--    1 root system       1920 May 28 10:24 /tmp/wtmp&lt;BR /&gt;   2074 -rw-r--r--    1 root system   23003136 Jan 20 08:51 wtmp&lt;BR /&gt;i2:/var/adm 128 # mv /tmp/wtmp wtmp&lt;BR /&gt;&lt;BR /&gt;All relevant info retained this way (boot time and such)&lt;BR /&gt;&lt;BR /&gt;Enjoy, Have FUN! H.Merijn&lt;BR /&gt;</description>
      <pubDate>Fri, 28 May 2004 03:30:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/clear-the-wtmp-file/m-p/3138992#M154806</guid>
      <dc:creator>H.Merijn Brand (procura</dc:creator>
      <dc:date>2004-05-28T03:30:10Z</dc:date>
    </item>
  </channel>
</rss>

