Operating System - HP-UX
1752795 Members
6207 Online
108789 Solutions
New Discussion юеВ

Re: How to trim the file.

 
unixguy_1
Regular Advisor

How to trim the file.

Hi Friends,

if /var file system is full and i checked the /var/adm/wtmp is more capacity.

so i thought i will trim this file,/var is going to less.

So pls anyone guide me

How to trim that file?

and

What are the steps to be followed to that problem.

Thanks in Advance.

Regards,
Unixguy.
7 REPLIES 7
Robert-Jan Goossens
Honored Contributor

Re: How to trim the file.

Hi,

# > /var/adm/wtmp
or
# cp /dev/null /var/adm/wtmp

--
What are the steps to be followed to that problem.
--

SAM > Routine Taks > System Logs > select your log file > Action > trim > Trim to ...

Regards,
Robert-Jan
Jeeshan
Honored Contributor

Re: How to trim the file.

right in this way

# cat /dev/null > /var/adm/wtmp
a warrior never quits
Dennis Handly
Acclaimed Contributor

Re: How to trim the file.

>I thought i will trim this file, /var is going to less.

Do you care about keeping any recent login stats?
Ganesan R
Honored Contributor

Re: How to trim the file.

Hi,

There might be other directories like /var/adm/sw, /var/adm/crash which may consume more space than /var/adm/wtmp. You can clear those directories instead of wtmp.

Use this command to check which dir consumed more space

#du -xk /var |sort -nr |head -25

Then you can decide which dir should be cleared off..
Best wishes,

Ganesh.
James R. Ferguson
Acclaimed Contributor

Re: How to trim the file.

Hi:

Do NOT manually munge with anything in '/var/adm/sw' no matter how large it is. To do so will probably render your server un-patchable. Instead, to regain space, do:

# cleanup -c 1

...which removes the rollback copies of patches commited at least once. Usually this returns significant space if you have been routinely patching.

Regardsa!

...JRF...
Nguyen Anh Tien
Honored Contributor

Re: How to trim the file.

very simple,
1, backup current log
#tar -cvf /tmp/oldlog.tar /var/adm/wtmp
2, then trim
#>/var/adm/wtmp

That all
tienna
HP is simple
Suraj K Sankari
Honored Contributor

Re: How to trim the file.

Hi,

The best way is

>/var/adm/wtmp

Maximum SA are using this way to trim any file.

Suraj