Operating System - HP-UX
1835846 Members
2548 Online
110085 Solutions
New Discussion

Re: how to reduce size or trim wtmp on HPUX

 
Pankaj_14
New Member

how to reduce size or trim wtmp on HPUX

Hi, wtmp file under /var/adm is over 100MB on my HPUX server and I would like to reduce the size. I can zip it but would like to know best practice to empty it.
will just "cat /dev/null > /var/adm/wtmp" works here?
5 REPLIES 5
Peter Leddy_1
Esteemed Contributor

Re: how to reduce size or trim wtmp on HPUX

Hi,

That should work fine or you can just do

> /var/adm/wtmp

OR

you can even do it through SAM if you prefer, in routine tasks.

Take your pick.

Regards,

Peter
Peter Godron
Honored Contributor

Re: how to reduce size or trim wtmp on HPUX

vz7r1x
Regular Advisor

Re: how to reduce size or trim wtmp on HPUX

Pankaj
1. zip the file to save contents for furure
2. cat /dev/null > /var/adm/wtmp (this will empty out wtmp)

By putting null contents into wtmp, you will not have to delete/re-create file, not deleting wtmp will also save you from permission isssue you may have later.

Thanks
vz7r1x
Regular Advisor

Re: how to reduce size or trim wtmp on HPUX

Pankaj
1. zip the file to save contents for furure
2. cat /dev/null > /var/adm/wtmp (this will empty out wtmp)

By putting null contents into wtmp, you will not have to delete/re-create file, not deleting wtmp will also save you from permission isssues you may have later.

Thanks
Pankaj_14
New Member

Re: how to reduce size or trim wtmp on HPUX

Thanks for quick reply.