- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: remove wtmp
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2003 06:07 AM
06-03-2003 06:07 AM
remove wtmp
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2003 06:09 AM
06-03-2003 06:09 AM
Re: remove wtmp
The proper way to empty it is:
# cat /dev/null > /var/adm/wtmp
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.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2003 06:10 AM
06-03-2003 06:10 AM
Re: remove wtmp
http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0xc1568b82cc91d711abdc0090277a778c,00.html
Massimo
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2003 06:11 AM
06-03-2003 06:11 AM
Re: remove wtmp
$>/var/adm/wtmp.
HTH
Umapathy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2003 06:13 AM
06-03-2003 06:13 AM
Re: remove wtmp
Note that wtmp and btmp tend to grow without bound, and should be
checked regularly. Information that is no longer useful should be
removed periodically to prevent it from becoming too large. Also note
that wtmp and btmp are not created by the programs that maintain them.
Thus, if these files are removed, record-keeping is turned off.
Easiest is
sam
routine tasks
system log files
select and reduce wtmp
Steve Steel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2003 06:14 AM
06-03-2003 06:14 AM
Re: remove wtmp
cat /dev/null >/var/adm/wtmp
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2003 06:15 AM
06-03-2003 06:15 AM
Re: remove wtmp
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2003 06:15 AM
06-03-2003 06:15 AM
Re: remove wtmp
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2003 06:16 AM
06-03-2003 06:16 AM
Re: remove wtmp
This explains it
10.1.3.1 Pruning the wtmp file
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.
For example, many monthly shell scripts contain a statement that looks like this:
# zero the log file
cat /dev/null >/var/adm/wtmp
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:
# make a copy of the log file and zero the old one
rm /var/adm/wtmp.old
ln /var/adm/wtmp /var/adm/wtmp.old
cp /dev/null /var/adm/wtmp.nul
mv /var/adm/wtmp.nul /var/adm/wtmp
Most versions of the last command allow you to specify a file to use other than wtmp by using the -f option. For example:
% last -f /var/adm/wtmp.old
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:
#!/bin/sh
mv /var/adm/wtmp /var/adm/wtmp.real
mv /var/adm/wtmp.old /var/adm/wtmp
last $*
mv /var/adm/wtmp /var/adm/wtmp.old
mv /var/adm/wtmp.real /var/adm/wtmp
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.
Steve Steel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2003 06:23 AM
06-03-2003 06:23 AM
Re: remove wtmp
Every Sunday morning, after the Friday's (FULL) backup we do the following to the wtmp file:
cat /dev/null > /var/adm/wtmp
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.
Regards,
DR
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2003 06:27 AM
06-03-2003 06:27 AM
Re: remove wtmp
cat /dev/null > /var/adm/wtmp doesn't release the space in this host, which can be seen from bdf output. Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2003 06:32 AM
06-03-2003 06:32 AM
Re: remove wtmp
# ls -la /var/adm/wtmp
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:
# du -k dir_name
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2003 06:36 AM
06-03-2003 06:36 AM
Re: remove wtmp
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2003 06:42 AM
06-03-2003 06:42 AM
Re: remove wtmp
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2003 07:05 AM
06-03-2003 07:05 AM
Re: remove wtmp
# lsof
# fuser
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2003 07:16 AM
06-03-2003 07:16 AM
Re: remove wtmp
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2003 10:25 PM
06-03-2003 10:25 PM
Re: remove wtmp
command line
to trim file to zero
$ > wtmp
You can also use SAM to trim the log files.
SAM -> Routine Tasks -> System Log Files here you can trim the other system log files.
Thanks & Regards
Sri