<?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: Resizing the wtmp file in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/resizing-the-wtmp-file/m-p/3008616#M128097</link>
    <description>Use SAM to resize it.&lt;BR /&gt;&lt;BR /&gt;SAM&lt;BR /&gt;Routine Task&lt;BR /&gt;System log files</description>
    <pubDate>Thu, 26 Jun 2003 11:59:44 GMT</pubDate>
    <dc:creator>Ken Hubnik_2</dc:creator>
    <dc:date>2003-06-26T11:59:44Z</dc:date>
    <item>
      <title>Resizing the wtmp file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/resizing-the-wtmp-file/m-p/3008615#M128096</link>
      <description>Good morning,&lt;BR /&gt;I see my wtmp file has data over one year.( 33 Megs) Also btmp. My goal is to run a script that shows the last login of all the users to see if there are users that do not log in offen and deal with them. Since this just returns the month-daty I can not be sure if it is this year or last.&lt;BR /&gt;Is there a setting I can do to this file so it does not grow over x size?&lt;BR /&gt;Or knowing this is a binery file how do I resize it?&lt;BR /&gt;&lt;BR /&gt;Marty</description>
      <pubDate>Thu, 26 Jun 2003 11:57:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/resizing-the-wtmp-file/m-p/3008615#M128096</guid>
      <dc:creator>Marty Metras</dc:creator>
      <dc:date>2003-06-26T11:57:12Z</dc:date>
    </item>
    <item>
      <title>Re: Resizing the wtmp file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/resizing-the-wtmp-file/m-p/3008616#M128097</link>
      <description>Use SAM to resize it.&lt;BR /&gt;&lt;BR /&gt;SAM&lt;BR /&gt;Routine Task&lt;BR /&gt;System log files</description>
      <pubDate>Thu, 26 Jun 2003 11:59:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/resizing-the-wtmp-file/m-p/3008616#M128097</guid>
      <dc:creator>Ken Hubnik_2</dc:creator>
      <dc:date>2003-06-26T11:59:44Z</dc:date>
    </item>
    <item>
      <title>Re: Resizing the wtmp file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/resizing-the-wtmp-file/m-p/3008617#M128098</link>
      <description>Hi,&lt;BR /&gt;As far i know, SAM is not able to resize it, it will trim it (resize it to 0). The best to do that&lt;BR /&gt;is to use /usr/sbin/acct/fwtmp. &lt;BR /&gt;This command can convert your wtmp/btmp files to ascii, you can then modify it/resize it to some 20 last record, and then use the same command to convert it back to binary.&lt;BR /&gt;Take a look man fwtmp.&lt;BR /&gt;&lt;BR /&gt;Cheers.</description>
      <pubDate>Thu, 26 Jun 2003 12:03:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/resizing-the-wtmp-file/m-p/3008617#M128098</guid>
      <dc:creator>Bruno Vidal</dc:creator>
      <dc:date>2003-06-26T12:03:21Z</dc:date>
    </item>
    <item>
      <title>Re: Resizing the wtmp file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/resizing-the-wtmp-file/m-p/3008618#M128099</link>
      <description>Marty,&lt;BR /&gt;&lt;BR /&gt;We use this cron entry:&lt;BR /&gt;00 01 1 * * /apps/bin/ts/wtmp_shrink 1&amp;gt;/dev/null 2&amp;gt;&amp;amp;1&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;and this script:&lt;BR /&gt;&lt;BR /&gt;#!/bin/ksh&lt;BR /&gt;################################################################################&lt;BR /&gt;#  wtmp_shrink   -   Reduce the size of /etc/wtmp.  Currently run from&lt;BR /&gt;#                    /etc/rc, also left as executable in /usr/bin.&lt;BR /&gt;#&lt;BR /&gt;&lt;BR /&gt;################################################################################&lt;BR /&gt;if [ -s /var/adm/wtmp ]&lt;BR /&gt;then&lt;BR /&gt;    echo "Shrinking /var/adm/wtmp"&lt;BR /&gt;    /usr/lib/acct/fwtmp &amp;lt; /var/adm/wtmp | tail -10 | /usr/lib/acct/fwtmp -ic &amp;gt; /&lt;BR /&gt;var/adm/wtmp&lt;BR /&gt;else&lt;BR /&gt;   echo "\n\tWtmp file does not exist"&lt;BR /&gt;   echo "\tCreating /var/adm/wtmp"&lt;BR /&gt;   &amp;gt; /var/adm/wtmp&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;to keep the size of the wtmp file in check.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Pete&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 26 Jun 2003 12:06:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/resizing-the-wtmp-file/m-p/3008618#M128099</guid>
      <dc:creator>Pete Randall</dc:creator>
      <dc:date>2003-06-26T12:06:29Z</dc:date>
    </item>
    <item>
      <title>Re: Resizing the wtmp file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/resizing-the-wtmp-file/m-p/3008619#M128100</link>
      <description>Hi,&lt;BR /&gt;you can empty this file if not useful:&lt;BR /&gt;&lt;BR /&gt;&amp;gt;wtmp&lt;BR /&gt;&amp;gt;btmp&lt;BR /&gt;&lt;BR /&gt;Enrico.</description>
      <pubDate>Thu, 26 Jun 2003 12:06:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/resizing-the-wtmp-file/m-p/3008619#M128100</guid>
      <dc:creator>Enrico P.</dc:creator>
      <dc:date>2003-06-26T12:06:42Z</dc:date>
    </item>
    <item>
      <title>Re: Resizing the wtmp file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/resizing-the-wtmp-file/m-p/3008620#M128101</link>
      <description>Marty,&lt;BR /&gt;   Normally I nullify/empty the contents of the wtmp file in regular intervals (say once in 15 days).  Write a cron job to do that.  To empty the contents use this.&lt;BR /&gt;&lt;BR /&gt;$cat /dev/null &amp;gt;wtmp &lt;BR /&gt;&lt;BR /&gt;HTH,&lt;BR /&gt;Umapathy</description>
      <pubDate>Thu, 26 Jun 2003 12:08:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/resizing-the-wtmp-file/m-p/3008620#M128101</guid>
      <dc:creator>Umapathy S</dc:creator>
      <dc:date>2003-06-26T12:08:32Z</dc:date>
    </item>
    <item>
      <title>Re: Resizing the wtmp file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/resizing-the-wtmp-file/m-p/3008621#M128102</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Bruno is right. The exact procedure is :&lt;BR /&gt;&lt;BR /&gt;# cat /var/adm/wtmp | /usr/sbin/acct/fwtmp &amp;gt; file&lt;BR /&gt;...&lt;BR /&gt;modify the file (using a script or vi)&lt;BR /&gt;...&lt;BR /&gt;# cat file | /usr/sbin/acct/fwtmp -ic &amp;gt; /var/adm/wtmp&lt;BR /&gt;&lt;BR /&gt;Regards.</description>
      <pubDate>Thu, 26 Jun 2003 12:08:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/resizing-the-wtmp-file/m-p/3008621#M128102</guid>
      <dc:creator>Jean-Louis Phelix</dc:creator>
      <dc:date>2003-06-26T12:08:54Z</dc:date>
    </item>
    <item>
      <title>Re: Resizing the wtmp file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/resizing-the-wtmp-file/m-p/3008622#M128103</link>
      <description>Pete,&lt;BR /&gt;I see in your script it is handling the binery stuff. Am I reading it right you are only saving 10 lines with the 'tail -10'?&lt;BR /&gt;I could just change that to whatwhat ever I need.&lt;BR /&gt;Marty</description>
      <pubDate>Thu, 26 Jun 2003 12:11:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/resizing-the-wtmp-file/m-p/3008622#M128103</guid>
      <dc:creator>Marty Metras</dc:creator>
      <dc:date>2003-06-26T12:11:35Z</dc:date>
    </item>
    <item>
      <title>Re: Resizing the wtmp file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/resizing-the-wtmp-file/m-p/3008623#M128104</link>
      <description>I got it.&lt;BR /&gt;Thanks jean I like what you showed me because I can pull the information from the ASCII file.&lt;BR /&gt;Then reload the wtmp with the new data.&lt;BR /&gt;Thanks Pete because I can automate the process with yours.&lt;BR /&gt;Thanks the rest of you because you opened my eyes to other thoughts.&lt;BR /&gt;Marty</description>
      <pubDate>Thu, 26 Jun 2003 12:20:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/resizing-the-wtmp-file/m-p/3008623#M128104</guid>
      <dc:creator>Marty Metras</dc:creator>
      <dc:date>2003-06-26T12:20:15Z</dc:date>
    </item>
    <item>
      <title>Re: Resizing the wtmp file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/resizing-the-wtmp-file/m-p/3008624#M128105</link>
      <description>Itr's important to note that wtmp, btmp (and utmp) have no year stored in the file so entries older than 1 year will cause strange behavior with programs trying to match up login and logout events. So trimming wtmp and btmp is an important sysadmin task. fwtmp can be used to convert to ASCII and then select the records to keep, or the file can simply be copied and the original zeroed out, perhaps once a month using cron. Note that doing this while running will leave an incomplete history since a login record may be in the old file and logout for the same session in the new file.&lt;BR /&gt;&lt;BR /&gt;Another solution is to use a start/stop script in /sbin/init.d to take care of logfile trimming and archiving.  Since most systems will need patches a couple of times during the year, the startup sequence can be used to archive the logs without problems due to users that are already logged in.</description>
      <pubDate>Thu, 26 Jun 2003 12:36:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/resizing-the-wtmp-file/m-p/3008624#M128105</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2003-06-26T12:36:28Z</dc:date>
    </item>
    <item>
      <title>Re: Resizing the wtmp file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/resizing-the-wtmp-file/m-p/3008625#M128106</link>
      <description>Marty,&lt;BR /&gt;&lt;BR /&gt;Yes - 10 lines - modify as needed.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Pete&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 26 Jun 2003 12:40:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/resizing-the-wtmp-file/m-p/3008625#M128106</guid>
      <dc:creator>Pete Randall</dc:creator>
      <dc:date>2003-06-26T12:40:47Z</dc:date>
    </item>
    <item>
      <title>Re: Resizing the wtmp file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/resizing-the-wtmp-file/m-p/3008626#M128107</link>
      <description>Good point Bill,&lt;BR /&gt;I found in the ASCII file that that it shows the year making it easy for me to look at the data with another script. being that it is only 500,000 lines long right now I think I will just use the ASCII copy and leave the wtmp binery file as is for now. After it is only 33MB and disc space is not a problem.&lt;BR /&gt;Thanks again,&lt;BR /&gt;Marty</description>
      <pubDate>Thu, 26 Jun 2003 12:46:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/resizing-the-wtmp-file/m-p/3008626#M128107</guid>
      <dc:creator>Marty Metras</dc:creator>
      <dc:date>2003-06-26T12:46:36Z</dc:date>
    </item>
  </channel>
</rss>

