- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- how to empty/reduce /var/adm/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
04-03-2003 02:01 AM
04-03-2003 02:01 AM
how to empty/reduce /var/adm/wtmp
I want to reduce the size of wtmp file. can somebody tell me how to recude it??
I want the file wtmp keep only the last 4 week login/session. So I need a script to put in the crontab.
Please tell me how to do that??
Thanks.
Regards,
John
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2003 02:09 AM
04-03-2003 02:09 AM
Re: how to empty/reduce /var/adm/wtmp
Here is utmp
/usr/lib/acct/fwtmp /tmp/utmp.ascii
vi /tmp/utmp.ascii
/usr/lib/acct/fwtmp -ic /etc/utmp
see man fwtmp and you will see
fwtmp(1M) fwtmp(1M)
NAME
fwtmp, wtmpfix - manipulate connect accounting records
With the command and a little experimentation you can do anything.
steve Steel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2003 02:13 AM
04-03-2003 02:13 AM
Re: how to empty/reduce /var/adm/wtmp
never tried this myself. check it out on a test box.
++++++++++
File utmp contains a record of all users logged onto the system. File
btmp contains bad login entries for each invalid logon attempt. File
wtmp contains a record of all logins and logouts.
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.
++++++++++++++
from the man page i assume that, u can just delete the wtmp and btmp files and just touch it so that it can be used again.
or just
> /var/adm/wtmp.
hth
-balaji
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2003 03:04 AM
04-03-2003 03:04 AM
Re: how to empty/reduce /var/adm/wtmp
I agreed with Balaji suggestion , the wtmp and utmp will grow tremendously if there are lot of logging. So the best way is to empty the files by
# > var/adm/wtmp or
# cat /dev/null > /var/adm/wtmp
or you can also use SAM to trim the log files
go to
SAM > Routine Tasks > System Log Files
from here you can trim the log files that you wanted to trim ; you can trim it to zero or the recommended size.
Thanks & Regards
Sri
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2003 03:10 AM
04-03-2003 03:10 AM
Re: how to empty/reduce /var/adm/wtmp
Tried to write you a perl script, but unfortunetly I could make it work the way you want.
The only thing I can think of is :
last -R -50 >/var/adm/wtmp.txt && >/var/adm/wtmp
This makes last display the last 50 lines inclusive hostnames display in the txt-file and afterwards wtmp will be emptied.
Hope this helps a little.
John, don't forget to give the people who helped you previous points for their answers.
Let's not be Dutch :) Be kind.
Oftwel gewoon even meehelpen.
Regs David