<?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: remove wtmp in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/remove-wtmp/m-p/2987476#M123663</link>
    <description>Hi!&lt;BR /&gt;&lt;BR /&gt;Every Sunday morning, after the Friday's (FULL) backup we do the following to the wtmp file:&lt;BR /&gt;&lt;BR /&gt;cat /dev/null &amp;gt; /var/adm/wtmp&lt;BR /&gt;&lt;BR /&gt;This will empty the file but will allow us to have a copy just in case we have to go back and look at it.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;DR</description>
    <pubDate>Tue, 03 Jun 2003 13:23:39 GMT</pubDate>
    <dc:creator>Dario_1</dc:creator>
    <dc:date>2003-06-03T13:23:39Z</dc:date>
    <item>
      <title>remove wtmp</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/remove-wtmp/m-p/2987467#M123654</link>
      <description>Since wtmp won't rotate in HPUX and it may grow huge. In which way that file can be removed and the occupied space can be released? lsof doesn't show which process use that file. Thanks.</description>
      <pubDate>Tue, 03 Jun 2003 13:07:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/remove-wtmp/m-p/2987467#M123654</guid>
      <dc:creator>George Liu_2</dc:creator>
      <dc:date>2003-06-03T13:07:33Z</dc:date>
    </item>
    <item>
      <title>Re: remove wtmp</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/remove-wtmp/m-p/2987468#M123655</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;The proper way to empty it is:&lt;BR /&gt;&lt;BR /&gt;# cat /dev/null &amp;gt; /var/adm/wtmp&lt;BR /&gt;&lt;BR /&gt;Of course, this will allow it to regrow.  If you don't want to continue logging, remove the file after you have nulled it.  In the absence, of a file, no logging will occur.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Tue, 03 Jun 2003 13:09:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/remove-wtmp/m-p/2987468#M123655</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2003-06-03T13:09:49Z</dc:date>
    </item>
    <item>
      <title>Re: remove wtmp</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/remove-wtmp/m-p/2987469#M123656</link>
      <description>Hi, look at this thread, there are many interesting issues&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0xc1568b82cc91d711abdc0090277a778c,00.html" target="_blank"&gt;http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0xc1568b82cc91d711abdc0090277a778c,00.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Massimo&lt;BR /&gt;</description>
      <pubDate>Tue, 03 Jun 2003 13:10:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/remove-wtmp/m-p/2987469#M123656</guid>
      <dc:creator>Massimo Bianchi</dc:creator>
      <dc:date>2003-06-03T13:10:05Z</dc:date>
    </item>
    <item>
      <title>Re: remove wtmp</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/remove-wtmp/m-p/2987470#M123657</link>
      <description>you can nullify like&lt;BR /&gt;&lt;BR /&gt;$&amp;gt;/var/adm/wtmp.&lt;BR /&gt;&lt;BR /&gt;HTH&lt;BR /&gt;Umapathy</description>
      <pubDate>Tue, 03 Jun 2003 13:11:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/remove-wtmp/m-p/2987470#M123657</guid>
      <dc:creator>Umapathy S</dc:creator>
      <dc:date>2003-06-03T13:11:08Z</dc:date>
    </item>
    <item>
      <title>Re: remove wtmp</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/remove-wtmp/m-p/2987471#M123658</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;      Note that wtmp and btmp tend to grow without bound, and should be&lt;BR /&gt;      checked regularly.  Information that is no longer useful should be&lt;BR /&gt;      removed periodically to prevent it from becoming too large.  Also note&lt;BR /&gt;      that wtmp and btmp are not created by the programs that maintain them.&lt;BR /&gt;      Thus, if these files are removed, record-keeping is turned off.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Easiest is&lt;BR /&gt;&lt;BR /&gt;sam&lt;BR /&gt;routine tasks&lt;BR /&gt;system log files&lt;BR /&gt;&lt;BR /&gt;select and reduce wtmp&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;         Steve Steel</description>
      <pubDate>Tue, 03 Jun 2003 13:13:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/remove-wtmp/m-p/2987471#M123658</guid>
      <dc:creator>Steve Steel</dc:creator>
      <dc:date>2003-06-03T13:13:39Z</dc:date>
    </item>
    <item>
      <title>Re: remove wtmp</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/remove-wtmp/m-p/2987472#M123659</link>
      <description>I simply empty it with /dev/null using : &lt;BR /&gt;&lt;BR /&gt;cat /dev/null &amp;gt;/var/adm/wtmp</description>
      <pubDate>Tue, 03 Jun 2003 13:14:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/remove-wtmp/m-p/2987472#M123659</guid>
      <dc:creator>Marco Santerre</dc:creator>
      <dc:date>2003-06-03T13:14:33Z</dc:date>
    </item>
    <item>
      <title>Re: remove wtmp</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/remove-wtmp/m-p/2987473#M123660</link>
      <description>You can use SAM -&amp;gt; Routine tasks -&amp;gt; System log files to trim the log files you need including /var/adm/wtmp. You can do this once in a while to cleanup space.&lt;BR /&gt;&lt;BR /&gt;If you don't want to go through SAM, just review your log files and trim to the level you need. I normally reduce the wtmp file to zero bytes, when it's safe. I do keep my old wtmp file for some time.</description>
      <pubDate>Tue, 03 Jun 2003 13:15:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/remove-wtmp/m-p/2987473#M123660</guid>
      <dc:creator>Helen French</dc:creator>
      <dc:date>2003-06-03T13:15:29Z</dc:date>
    </item>
    <item>
      <title>Re: remove wtmp</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/remove-wtmp/m-p/2987474#M123661</link>
      <description>The lsof won't show because it's only written when a user logs in and it keeps the history of all logins. Empty it (like other have suggested) is the way to go as you would want to keep this file so that it continues to log.</description>
      <pubDate>Tue, 03 Jun 2003 13:15:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/remove-wtmp/m-p/2987474#M123661</guid>
      <dc:creator>S.K. Chan</dc:creator>
      <dc:date>2003-06-03T13:15:45Z</dc:date>
    </item>
    <item>
      <title>Re: remove wtmp</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/remove-wtmp/m-p/2987475#M123662</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;This explains it&lt;BR /&gt;&lt;BR /&gt;10.1.3.1 Pruning the wtmp file&lt;BR /&gt;The wtmp file will continue to grow until you have no space left on your computer's hard disk. For this reason, many vendors include shell scripts with their UNIX releases that zero the wtmp file automatically on a regular basis (such as once a week or once a month). These scripts are run automatically by the cron program.&lt;BR /&gt;&lt;BR /&gt;For example, many monthly shell scripts contain a statement that looks like this:&lt;BR /&gt;&lt;BR /&gt;# zero the log file&lt;BR /&gt;cat /dev/null &amp;gt;/var/adm/wtmp&lt;BR /&gt;Instead of this simple-minded approach, you may wish to make a copy of the wtmp file first, so you'll be able to refer to logins in the previous month. To do so, you must locate the shell script that zeros your log file and add the following lines:&lt;BR /&gt;&lt;BR /&gt;# make a copy of the log file and zero the old one&lt;BR /&gt;rm /var/adm/wtmp.old&lt;BR /&gt;ln /var/adm/wtmp /var/adm/wtmp.old&lt;BR /&gt;cp /dev/null /var/adm/wtmp.nul&lt;BR /&gt;mv /var/adm/wtmp.nul /var/adm/wtmp&lt;BR /&gt;Most versions of the last command allow you to specify a file to use other than wtmp by using the -f option. For example:&lt;BR /&gt;&lt;BR /&gt;% last -f /var/adm/wtmp.old&lt;BR /&gt;Some versions of the last command do not allow you to specify a different wtmp file to search through. If you need to check this previous copy and you are using one of these systems, you will need to momentarily place the copy of the wtmp file back into its original location. For example, you might use the following shell script to do the trick:&lt;BR /&gt;&lt;BR /&gt;#!/bin/sh&lt;BR /&gt;mv /var/adm/wtmp /var/adm/wtmp.real&lt;BR /&gt;mv /var/adm/wtmp.old /var/adm/wtmp&lt;BR /&gt;last $*&lt;BR /&gt;mv /var/adm/wtmp /var/adm/wtmp.old&lt;BR /&gt;mv /var/adm/wtmp.real /var/adm/wtmp&lt;BR /&gt;This approach is not without its problems, however. Any logins and logouts will be logged to the wtmp.old file while the command is running.&lt;BR /&gt;&lt;BR /&gt;            Steve Steel</description>
      <pubDate>Tue, 03 Jun 2003 13:16:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/remove-wtmp/m-p/2987475#M123662</guid>
      <dc:creator>Steve Steel</dc:creator>
      <dc:date>2003-06-03T13:16:32Z</dc:date>
    </item>
    <item>
      <title>Re: remove wtmp</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/remove-wtmp/m-p/2987476#M123663</link>
      <description>Hi!&lt;BR /&gt;&lt;BR /&gt;Every Sunday morning, after the Friday's (FULL) backup we do the following to the wtmp file:&lt;BR /&gt;&lt;BR /&gt;cat /dev/null &amp;gt; /var/adm/wtmp&lt;BR /&gt;&lt;BR /&gt;This will empty the file but will allow us to have a copy just in case we have to go back and look at it.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;DR</description>
      <pubDate>Tue, 03 Jun 2003 13:23:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/remove-wtmp/m-p/2987476#M123663</guid>
      <dc:creator>Dario_1</dc:creator>
      <dc:date>2003-06-03T13:23:39Z</dc:date>
    </item>
    <item>
      <title>Re: remove wtmp</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/remove-wtmp/m-p/2987477#M123664</link>
      <description>Don't know why, but &lt;BR /&gt;cat /dev/null &amp;gt; /var/adm/wtmp doesn't release the space in this host, which can be seen from bdf output. Thanks.</description>
      <pubDate>Tue, 03 Jun 2003 13:27:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/remove-wtmp/m-p/2987477#M123664</guid>
      <dc:creator>George Liu_2</dc:creator>
      <dc:date>2003-06-03T13:27:40Z</dc:date>
    </item>
    <item>
      <title>Re: remove wtmp</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/remove-wtmp/m-p/2987478#M123665</link>
      <description>What is the size of wtmp file now?:&lt;BR /&gt;&lt;BR /&gt;# ls -la /var/adm/wtmp&lt;BR /&gt;&lt;BR /&gt;If the size is 0bytes and if bdf still shows the size is not reduced, then it's a bdf issue. Some process stil holding the file system space. It will be released as soon as the process is finished. Also for a better disk usage:&lt;BR /&gt;&lt;BR /&gt;# du -k dir_name</description>
      <pubDate>Tue, 03 Jun 2003 13:32:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/remove-wtmp/m-p/2987478#M123665</guid>
      <dc:creator>Helen French</dc:creator>
      <dc:date>2003-06-03T13:32:57Z</dc:date>
    </item>
    <item>
      <title>Re: remove wtmp</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/remove-wtmp/m-p/2987479#M123666</link>
      <description>The wtmp file size is 0, and du -sk shows /var/adm updated size, but bdf doesn't.</description>
      <pubDate>Tue, 03 Jun 2003 13:36:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/remove-wtmp/m-p/2987479#M123666</guid>
      <dc:creator>George Liu_2</dc:creator>
      <dc:date>2003-06-03T13:36:29Z</dc:date>
    </item>
    <item>
      <title>Re: remove wtmp</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/remove-wtmp/m-p/2987480#M123667</link>
      <description>Shiju,&lt;BR /&gt;You got the point. However, lsof cannot find the processes. If it is kernel, we have to wait until next reboot. Is there any way to identify the processes? Thanks.</description>
      <pubDate>Tue, 03 Jun 2003 13:42:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/remove-wtmp/m-p/2987480#M123667</guid>
      <dc:creator>George Liu_2</dc:creator>
      <dc:date>2003-06-03T13:42:02Z</dc:date>
    </item>
    <item>
      <title>Re: remove wtmp</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/remove-wtmp/m-p/2987481#M123668</link>
      <description>Two commands which I can think of:&lt;BR /&gt;&lt;BR /&gt;# lsof&lt;BR /&gt;# fuser&lt;BR /&gt;&lt;BR /&gt;Also, try logging out from the system and log back in (for all users if possible). That may release the space. I wouldn't care about this since, you could see the space is free now, from 'du' output. It's just a matter of 'bdf' reporting wrongly.</description>
      <pubDate>Tue, 03 Jun 2003 14:05:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/remove-wtmp/m-p/2987481#M123668</guid>
      <dc:creator>Helen French</dc:creator>
      <dc:date>2003-06-03T14:05:27Z</dc:date>
    </item>
    <item>
      <title>Re: remove wtmp</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/remove-wtmp/m-p/2987482#M123669</link>
      <description>Most likely, they both report correctly. Since the file wtmp was changed to new inodes, the old inodes may still be employed by some processes and couldn't be accessed via wtmp any more. I don't know how to deal with that kind of situation. Thanks.</description>
      <pubDate>Tue, 03 Jun 2003 14:16:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/remove-wtmp/m-p/2987482#M123669</guid>
      <dc:creator>George Liu_2</dc:creator>
      <dc:date>2003-06-03T14:16:09Z</dc:date>
    </item>
    <item>
      <title>Re: remove wtmp</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/remove-wtmp/m-p/2987483#M123670</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;command line &lt;BR /&gt;to trim file to zero&lt;BR /&gt;&lt;BR /&gt;$ &amp;gt; wtmp &lt;BR /&gt;&lt;BR /&gt;You can also  use SAM to trim the log files.&lt;BR /&gt;&lt;BR /&gt;SAM -&amp;gt; Routine Tasks -&amp;gt; System Log Files here you can trim the other system log files.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks &amp;amp; Regards&lt;BR /&gt;Sri</description>
      <pubDate>Wed, 04 Jun 2003 05:25:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/remove-wtmp/m-p/2987483#M123670</guid>
      <dc:creator>Sritharan</dc:creator>
      <dc:date>2003-06-04T05:25:22Z</dc:date>
    </item>
  </channel>
</rss>

