Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Clearing out /var/adm/wtmpx and /var/adm/wtmp on Solaris 2.x

Status
Not open for further replies.

scb

MIS
Feb 19, 1999
8
0
0
US

What's the proper way to clean up /var/adm/wtmp and
/var/adm/wtmpx in Solaris 2.x? These files can grow
quite large (especially wtmpx) and we need to know how
to clean these up without sacrificing their functions.
They aren't regular text files and they are open files
that are continuously written to. They are related to
/var/adm/utmp and /var/adm/utmpx (and others? such as
/var/log/authlog and /var/adm/lastlog?). What
precautions should be taken when truncating or zeroing
them out? What are the procedures to do this? We
would like to keep the last 1000 lines or so (of each
file?). Are their built-in Solaris utilities for this
task? How are each of the files related? Will
truncating one and not the others cause problems or
render related files
unusable?

Thanks,

BZ
 
BZ,
I have never paid attention to these files, but they are accounting files. Hopefully, someone can give you advice on them, but in the mean time, take a look at the man page for acct That will give you a good start.

pt
 
I wouldn't worry too much about zeroing them out. I do this on a regular basis with no problems. Cheers.
 
No problem with zeroing them out.
I have done without glitches.
do cat /dev/null > wtmpx
 
I agree with the above replies, but I usually move the original to /tmp and tar and gzip it (just in case, you never know). I leave the gzip in /tmp and truncate the wtmp(x) files by doing ">wtmp". I've never had a problem doing this. d3funct
zimmer.jon@cfwy.com
The software required `Windows 95 or better', so I installed Linux.

 
Brooks Davis has made two nice perl-scripts for the purpose.
Here is a description
Both scripts keep all entries for the last x days,
and it keeps reboot information, time changes etc indefinitely.
Just what you ask for.
I have used them occasionally, and they work OK.

JMA
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top