Operating System - HP-UX
1831097 Members
2561 Online
110019 Solutions
New Discussion

how do i null or flatten a log file

 
SOLVED
Go to solution
Ravinder Singh Gill
Regular Advisor

how do i null or flatten a log file

space utilisation is becoming quite high and i have noticed that the logfiles are quite big. how do i flatten them or set them to null
6 REPLIES 6
Pete Randall
Outstanding Contributor
Solution

Re: how do i null or flatten a log file

You can use SAM > Routine Tasks or you can simply do this:

> /var/logfilename


Pete

Pete
Ravinder Singh Gill
Regular Advisor

Re: how do i null or flatten a log file

so if my logfile was /var/june/abclog

id simply:

> /var/june/abclog ??
Donald Kok
Respected Contributor

Re: how do i null or flatten a log file

you can save (f.i.) the last 100 lines of the logfile:

mv log log.old
tail -n 100 log.old > log
rm log.old
My systems are 100% Murphy Compliant. Guaranteed!!!
Vibhor Kumar Agarwal
Esteemed Contributor

Re: how do i null or flatten a log file

cat /dev/null > log_file
Vibhor Kumar Agarwal
Ravinder Singh Gill
Regular Advisor

Re: how do i null or flatten a log file

thanks
Pete Randall
Outstanding Contributor

Re: how do i null or flatten a log file

Yep!

> /var/june/abclog

is exactly what you would do.


Pete

Pete