<?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: sizes of wtmp &amp;amp; btmp too large in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/sizes-of-wtmp-amp-btmp-too-large/m-p/2533064#M25488</link>
    <description>Ron, &lt;BR /&gt;I trim my system logs every week manually to keep a constant check on things.  Here's how I do it:&lt;BR /&gt;&lt;BR /&gt;Trim system logs:&lt;BR /&gt;Logon as root&lt;BR /&gt;Sam (return)&lt;BR /&gt;routine tasks (return)&lt;BR /&gt;system logfiles  (ret)&lt;BR /&gt;Highlight /var/adm/btmp&lt;BR /&gt;               /var/adm/wtmp&lt;BR /&gt;Tab-&amp;gt;Actions-&amp;gt;Trim-&amp;gt;Trim to zero &lt;BR /&gt;Exit&lt;BR /&gt;&lt;BR /&gt;Lisa&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Fri, 25 May 2001 18:00:05 GMT</pubDate>
    <dc:creator>Lisa Moore</dc:creator>
    <dc:date>2001-05-25T18:00:05Z</dc:date>
    <item>
      <title>sizes of wtmp &amp; btmp too large</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sizes-of-wtmp-amp-btmp-too-large/m-p/2533060#M25484</link>
      <description>Hi,&lt;BR /&gt;I recently noticed a low amount of space in /var. I the process of trying to clean up some old files, I came across wtmp and btmp. Both of these files are pretty large (wtmp is over 90 Meg.) Since I can't vi the files to trim them down, what would be the best method. If I removed them and than touch them, would there be any repercussions. Also, is there an easy way to automatically trim them in the future?&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Ron&lt;BR /&gt;</description>
      <pubDate>Fri, 25 May 2001 17:09:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sizes-of-wtmp-amp-btmp-too-large/m-p/2533060#M25484</guid>
      <dc:creator>Ron Bromwell</dc:creator>
      <dc:date>2001-05-25T17:09:50Z</dc:date>
    </item>
    <item>
      <title>Re: sizes of wtmp &amp; btmp too large</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sizes-of-wtmp-amp-btmp-too-large/m-p/2533061#M25485</link>
      <description>Hi Ron:&lt;BR /&gt;&lt;BR /&gt;To trim them to an empty file do this:&lt;BR /&gt;&lt;BR /&gt;# cat /dev/null &amp;gt; /var/adm/wtmp&lt;BR /&gt;# cat /dev/null &amp;gt; /var/adm/btmp&lt;BR /&gt;&lt;BR /&gt;If you never want them built, remove them entirely.  This shuts off the logging functions when (at least) an empty file doesn't exist.&lt;BR /&gt;&lt;BR /&gt;If you want to analyze and manage these files in a more rigorous manner, take a look at 'acctcon' (man 1M) and 'fwtmp' (man 1M).&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Fri, 25 May 2001 17:22:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sizes-of-wtmp-amp-btmp-too-large/m-p/2533061#M25485</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2001-05-25T17:22:14Z</dc:date>
    </item>
    <item>
      <title>Re: sizes of wtmp &amp; btmp too large</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sizes-of-wtmp-amp-btmp-too-large/m-p/2533062#M25486</link>
      <description>The easiest way to handle them is to null them out like this:&lt;BR /&gt;&lt;BR /&gt;&amp;gt;wtmp&lt;BR /&gt;&amp;gt;btmp&lt;BR /&gt;&lt;BR /&gt;This will set the file size back to zero while the file is still open.  If you have problems with these files getting large, you could probably put something like this into cron.</description>
      <pubDate>Fri, 25 May 2001 17:24:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sizes-of-wtmp-amp-btmp-too-large/m-p/2533062#M25486</guid>
      <dc:creator>John Poff</dc:creator>
      <dc:date>2001-05-25T17:24:13Z</dc:date>
    </item>
    <item>
      <title>Re: sizes of wtmp &amp; btmp too large</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sizes-of-wtmp-amp-btmp-too-large/m-p/2533063#M25487</link>
      <description>Hello Ron,&lt;BR /&gt;You can truncate them with these commands:&lt;BR /&gt;&lt;BR /&gt;&amp;gt;/var/adm/wtmp&lt;BR /&gt;&amp;gt;/var/adm/btmp&lt;BR /&gt;&lt;BR /&gt;But before you do that, please understand that these files contain the history of logins to your server. In other words, these files are used by commands like 'last' and 'finger' to tell you who, when and from where has been in your server. We usually keep 3 months worth of history at all times.&lt;BR /&gt;You can copy these files to a filesystem with more space and still be able to access its information, for ex:&lt;BR /&gt;last -f /otherfs/wtmp&lt;BR /&gt;&lt;BR /&gt;HTH,&lt;BR /&gt;Luis</description>
      <pubDate>Fri, 25 May 2001 17:25:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sizes-of-wtmp-amp-btmp-too-large/m-p/2533063#M25487</guid>
      <dc:creator>thewho?</dc:creator>
      <dc:date>2001-05-25T17:25:56Z</dc:date>
    </item>
    <item>
      <title>Re: sizes of wtmp &amp; btmp too large</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sizes-of-wtmp-amp-btmp-too-large/m-p/2533064#M25488</link>
      <description>Ron, &lt;BR /&gt;I trim my system logs every week manually to keep a constant check on things.  Here's how I do it:&lt;BR /&gt;&lt;BR /&gt;Trim system logs:&lt;BR /&gt;Logon as root&lt;BR /&gt;Sam (return)&lt;BR /&gt;routine tasks (return)&lt;BR /&gt;system logfiles  (ret)&lt;BR /&gt;Highlight /var/adm/btmp&lt;BR /&gt;               /var/adm/wtmp&lt;BR /&gt;Tab-&amp;gt;Actions-&amp;gt;Trim-&amp;gt;Trim to zero &lt;BR /&gt;Exit&lt;BR /&gt;&lt;BR /&gt;Lisa&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 25 May 2001 18:00:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sizes-of-wtmp-amp-btmp-too-large/m-p/2533064#M25488</guid>
      <dc:creator>Lisa Moore</dc:creator>
      <dc:date>2001-05-25T18:00:05Z</dc:date>
    </item>
    <item>
      <title>Re: sizes of wtmp &amp; btmp too large</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sizes-of-wtmp-amp-btmp-too-large/m-p/2533065#M25489</link>
      <description>Thanks for the help with this. I'll have to try and script something to clean these up after they hit a certain size. Just wanted to make sure I would not cause any major system problems by empting them</description>
      <pubDate>Fri, 25 May 2001 18:23:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sizes-of-wtmp-amp-btmp-too-large/m-p/2533065#M25489</guid>
      <dc:creator>Ron Bromwell</dc:creator>
      <dc:date>2001-05-25T18:23:36Z</dc:date>
    </item>
    <item>
      <title>Re: sizes of wtmp &amp; btmp too large</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sizes-of-wtmp-amp-btmp-too-large/m-p/2533066#M25490</link>
      <description>Here is the script I use to trim them wtmp down. It is interactive so I can select the data before which I don't care about the info.&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/ksh&lt;BR /&gt;set -x&lt;BR /&gt; print " get wtmp in ascii format"&lt;BR /&gt; /usr/sbin/acct/fwtmp  &lt;WTMP&gt; /var/tmp/wtmp.out&lt;BR /&gt;&lt;BR /&gt; print "edit wtmp "&lt;BR /&gt;sleep 3&lt;BR /&gt; vi  /var/tmp/wtmp.out&lt;BR /&gt;&lt;BR /&gt; print "put it back in binary format"&lt;BR /&gt; /usr/sbin/acct/fwtmp -ic &amp;lt; /var/tmp/wtmp.out &amp;gt;wtmp&lt;BR /&gt;&lt;BR /&gt; print " remove ascii file then verify wtmp"&lt;BR /&gt;sleep 3&lt;BR /&gt; rm  /var/tmp/wtmp.out&lt;BR /&gt;&lt;BR /&gt;read ans?"Verify ? y/[n] "&lt;BR /&gt;&lt;BR /&gt;[[ $ans = [yY] ]] &amp;amp;&amp;amp;&lt;BR /&gt; /usr/sbin/acct/fwtmp  &lt;/WTMP&gt;</description>
      <pubDate>Fri, 25 May 2001 18:29:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sizes-of-wtmp-amp-btmp-too-large/m-p/2533066#M25490</guid>
      <dc:creator>Michael Roberts_3</dc:creator>
      <dc:date>2001-05-25T18:29:55Z</dc:date>
    </item>
    <item>
      <title>Re: sizes of wtmp &amp; btmp too large</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sizes-of-wtmp-amp-btmp-too-large/m-p/2533067#M25491</link>
      <description>Before you start just blanking these files, you should first understand what they are for.&lt;BR /&gt;&lt;BR /&gt;Someone said" they trim these logs weekly to keep a constant check on things".  Since these are the system accounting logs, anyone who Just trims them really has not a clue of what is going on on their system!!!&lt;BR /&gt;&lt;BR /&gt;If you want to know what is going on on your system I recommend to Administrators to enable accounting, and view accounting results before just removing them.&lt;BR /&gt;&lt;BR /&gt;If you process accounting, the accounting processes zero out these files for you, convert to C format, and make some nice readable text for you.  To setup accounting, do this.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;vi /etc/rc.config.d/acct&lt;BR /&gt;change START_ACCT=0 to START_ACCT=1&lt;BR /&gt;* this starts accounting at boot time.&lt;BR /&gt;&lt;BR /&gt;Next, run "/usr/sbin/acct/startup"  This will set things up, and turn on the accounting systems.&lt;BR /&gt;&lt;BR /&gt;Next, vi /etc/acct/holidays.  Probably only have to change the year, but you can setup quite a bit there.&lt;BR /&gt;&lt;BR /&gt;Next add this entry to cron&lt;BR /&gt;01 00 * * * * /usr/sbin/acct/runacct;/usr/sbin/acct/ckpacct&lt;BR /&gt;&lt;BR /&gt;runacct will run your daily accounting.  ckpacct will check to see if disk is full, and disable accounting if it is.&lt;BR /&gt;&lt;BR /&gt;Your easiest data to process by printing or paging is under /var/adm/acct/sum and will be called rprt$MM$DD where $MM is the 2 digit month, and $DD is the 2 digit day of the month.&lt;BR /&gt;&lt;BR /&gt;It is recommended that you enable the accounting as the user "adm" and also have the user "adm" launch the accounting process scripts.  &lt;BR /&gt;&lt;BR /&gt;Of course, read the man pages, because the accounting is very powerfull, and provides a lot of information about activity on your system.  Most of this information is in the reports, but there is alot in the raw C files too!&lt;BR /&gt;&lt;BR /&gt;I find it quite amazing how many admins just blow away the accounting files, oblivious to the data they can provide!  Especially when they can never say why things happen on their servers and complain about the OS!&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Shannon</description>
      <pubDate>Fri, 25 May 2001 21:04:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sizes-of-wtmp-amp-btmp-too-large/m-p/2533067#M25491</guid>
      <dc:creator>Shannon Petry</dc:creator>
      <dc:date>2001-05-25T21:04:19Z</dc:date>
    </item>
    <item>
      <title>Re: sizes of wtmp &amp; btmp too large</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sizes-of-wtmp-amp-btmp-too-large/m-p/2533068#M25492</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Many respondants have suggested trimming the wtmp file to zero bytes.  In my experience, 5 minutes after doing so you will want the data you just removed.&lt;BR /&gt;&lt;BR /&gt;I suggest the following in a cron job:&lt;BR /&gt;&lt;BR /&gt;cp /var/adm/wtmp /var/adm/wtmp.old&lt;BR /&gt;cat /dev/null &amp;gt; /var/adm/wtmp&lt;BR /&gt;&lt;BR /&gt;Thus, if you run this monthly, you will always have at least one month's worth of data but never more than two.&lt;BR /&gt;&lt;BR /&gt;--Bruce</description>
      <pubDate>Sat, 26 May 2001 01:24:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sizes-of-wtmp-amp-btmp-too-large/m-p/2533068#M25492</guid>
      <dc:creator>Bruce Regittko_1</dc:creator>
      <dc:date>2001-05-26T01:24:39Z</dc:date>
    </item>
  </channel>
</rss>

