Solved

Best way to clean /var/wtmpx file

Posted on 2012-04-10
5
1,895 Views
Last Modified: 2012-05-08
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
Comment
Question by:bbbb44
  • 3
  • 2
5 Comments
 
LVL 16

Expert Comment

by:Joseph Gan
ID: 37831028
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
 

Author Comment

by:bbbb44
ID: 37831048
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
 
LVL 16

Expert Comment

by:Joseph Gan
ID: 37831057
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
 
LVL 16

Accepted Solution

by:
Joseph Gan earned 500 total points
ID: 37831063
But the command is "echo '" > /var/adm/utmpx" or "echo "' > /var/adm/wtmpx"
0
 

Author Comment

by:bbbb44
ID: 37831065
Thanks ganjos, I'll run the >/var/adm/wtmpx command to clear the file.

Thx,

Brownson
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

A metadevice consists of one or more devices (slices). It can be expanded by adding slices. Then, it can be grown to fill a larger space while the file system is in use. However, not all UNIX file systems (UFS) can be expanded this way. The conca…
Using libpcap/Jpcap to capture and send packets on Solaris version (10/11) Library used: 1.      Libpcap (http://www.tcpdump.org) Version 1.2 2.      Jpcap(http://netresearch.ics.uci.edu/kfujii/Jpcap/doc/index.html) Version 0.6 Prerequisite: 1.      GCC …
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now