Operating System - HP-UX
1823472 Members
2342 Online
109660 Solutions
New Discussion юеВ

wtmp file growing in /var/adm

 
SOLVED
Go to solution
De Marez Krist
Occasional Contributor

wtmp file growing in /var/adm

Hello,

I have a file in the directory /var/adm called 'wtmp' that is growing all the time. I can't find out what process is updating this file so I don't know how to prevent it from growing bigger.
Does anyone have any idea what process is updating this file or how to maintain this file. Can it be deleted ? Or would it disappear when restarting the machine ?

I would appreciate any help since this file is now about 50 MB big, and I don't believe this can be the purpose.

Thanks.
5 REPLIES 5
James Odak
Valued Contributor

Re: wtmp file growing in /var/adm

the wtmp file is a log of all your the connections/logins to your system including the port, time and source (IP or other server)
who -u /var/adm/wtmp is how you read it
you can back this file up to tape/disk or even delete it if you are not concerned with the info in it

to answer your question though, the file grows everytime someone logs in


Jim
James R. Ferguson
Acclaimed Contributor
Solution

Re: wtmp file growing in /var/adm

Hi:

If you do not want this information at all, then remove /var/adm/wtmp. The absence of this file, in the first place, keeps it from growing. To properly reduce its size, do:

# cat /dev/null > /var/adm/wtmp

The file is a history of successful user login/logouts. There is a companion file /var/adm/btmp which holds a record of unsuccessful logins. If you don't want this history, either, then remove the btmp file.

If you later decide that you do want to track either good and/or bad logins, then, as root, simply touch the appropriate file to create it:

# touch /var/adm/wtmp
# chmod 644 /var/adm/wtmp

See the man pages for 'last'.

...JRF...
Alex Glennie
Honored Contributor

Re: wtmp file growing in /var/adm

try using the search facility top left I'm sure this has been covered in earlier discussions.

eg ....
http://forums.itrc.hp.com/cm/QuestionAnswer/1,1150,0xf3ea6c96588ad4118fef0090279cd0f9,00.html

is one string that answers some of your questions .... man wtmp is another .
Carlos Fernandez Riera
Honored Contributor

Re: wtmp file growing in /var/adm

Wtmp and utmp are files where is recorded each login done in your machine.

50 Mb is a very large file. Use last command to see information on this file.

To reset size do >wtmp. I like to do this in single user or before a reboot.

See man last, wtmp and login.
unsupported
De Marez Krist
Occasional Contributor

Re: wtmp file growing in /var/adm

Thank you all !

I am sorry, I fired the question too early and I just found out the answer in earlier discussions.

This happens (I guess) when you'r new to this forum.