• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2374
  • Last Modified:

Best way to clean /var/wtmpx file

Hi Expert,

I have a small soalris 10 machine that the /var is getting full, and noticed the /var/adm/wtmpx file is pretty big.
what's the best way to clean it up without disrupting, or losing function? can this be done while having users login without losing there session?

The OS is Solaris 10.

Thanks in Advance.

B4
0
bbbb44
Asked:
bbbb44
  • 3
  • 2
1 Solution
 
Joseph GanSystem AdminCommented:
From the "man wtmpx":
...
The utmpx  database  contains  user  access  and  accounting
     information  for  commands  such  as  who(1),  write(1), and
     login(1). The wtmpx database contains the  history  of  user
     access and accounting information for the  utmpx database.
...

What you could do is, stop utmpd (utmpx monitoring daemon):
# /etc/init.d/utmpd stop

Then, you can move or delete ( depands on what you want to do with the database ) the file. And touch a new file, then restart the daemon.

You can do this at any time, won't losing any users login and sessions. Only will lose some accounting information during which the daemon is shut down.
0
 
bbbb44Author Commented:
Hi Ganjos,

Thanks for the response.

would doing the #echo "" /var/adm/utmpx command provides the same result as your method? any consequence to the users that are currently login with this command?

Thanks,

B4
0
 
Joseph GanSystem AdminCommented:
Hey, this command will clean up the utmpx file, so you will lost all the accounting information, other than that no consequence what so ever to the users login.
0
 
Joseph GanSystem AdminCommented:
But the command is "echo '" > /var/adm/utmpx" or "echo "' > /var/adm/wtmpx"
0
 
bbbb44Author Commented:
Thanks ganjos, I'll run the >/var/adm/wtmpx command to clear the file.

Thx,

Brownson
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now