1753519 Members
4788 Online
108795 Solutions
New Discussion юеВ

Re: Trim system log file

 
Wantit Tangrugsasut
Occasional Contributor

Trim system log file

Hi,

I use HP/UX 9000 and I ran to file system problem. I think the size is getting too big.

Please suggest how to trim system log file
or anyway to free up some disk space

Thank You,

Wantit

10 REPLIES 10
Rob Smith
Respected Contributor

Re: Trim system log file

Hi, try this little script:
#!/usr/bin/sh
##
###

syslog=/var/adm/syslog/syslog.log



cp -p$syslog /var/adm/syslog/syslog.log.$(date +%m%d%y)
> $syslog

Then what I usually do is gzip the backed up syslog file and this saves a lot of space. Hope this helps.

Rob

Learn the rules so you can break them properly.
Wantit Tangrugsasut
Occasional Contributor

Re: Trim system log file

Thank you Rob. I will try it

Wantit
Mark Vollmers
Esteemed Contributor

Re: Trim system log file

In SAM there is an option where you can look at all the system files. This will show the size, and maximum size (although it will go over this), and the percentage full. Some of the logs will be over 100%. You can change the max size and also use SAM to trim the file to whatever you want (to 0, to 10% of max, whatever). This is hepful since you can see all the logs and so you can get an idea for the ones that will get out of hand.

Mark
"We apologize for the inconvience" -God's last message to all creation, from Douglas Adams "So Long and Thanks for all the Fish"
CHRIS ANORUO
Honored Contributor

Re: Trim system log file

You can trim the following files/log files to zero as follows:
cat /dev/null > /var/adm/syslog/syslog.log
cat /dev/null > /var/adm/wtmp
cat /dev/null > /var/adm/wtmp
Remove the files in /var/adm/preserve (Ex*)
When We Seek To Discover The Best In Others, We Somehow Bring Out The Best In Ourselves.
CHRIS ANORUO
Honored Contributor

Re: Trim system log file

You can trim the following files/log files to zero as follows:
cat /dev/null > /var/adm/syslog/syslog.log
cat /dev/null > /var/adm/wtmp
cat /dev/null > /var/adm/wtmp
Remove the files in /var/adm/preserve (Ex*)
Also you can use the cleanup command to remove old patches. (cleanup -F)
When We Seek To Discover The Best In Others, We Somehow Bring Out The Best In Ourselves.
Wantit Tangrugsasut
Occasional Contributor

Re: Trim system log file

Hi, Mark

Thanks for your reply

You said "use SAM to trim the file"

Did you talk about freedisk in Find and Remove Unused Filesets or you mean something else?

How can you trim the file in SAM?

Wantit
John Bolene
Honored Contributor

Re: Trim system log file

In SAM, go to routine tasks, system log files, and select the trim the file option.

You can trim to zero or a selected KB size.
It is always a good day when you are launching rockets! http://tripolioklahoma.org, Mostly Missiles http://mostlymissiles.com
Wantit Tangrugsasut
Occasional Contributor

Re: Trim system log file

Hi, Chris

Is it safe to set those files to empty?

Is cleanup command available in hp/ux 10.2?

Wantit
CHRIS ANORUO
Honored Contributor

Re: Trim system log file

Cleanup patch utility is available on 10.20. You can reduce the files if you don't have any security check on the wtmp and btmp.
When We Seek To Discover The Best In Others, We Somehow Bring Out The Best In Ourselves.