Operating System - HP-UX
1834394 Members
1781 Online
110066 Solutions
New Discussion

limit system log file sizes

 
SOLVED
Go to solution
Ross Hansen
Occasional Advisor

limit system log file sizes

I have a HPUX 11.11 hfs only system. I need to limit the system log file sizes. I have found in SAM where I can place a autommatic cap on the SAM log file, but none of the other logs. Can anyone point me in the right direction.
5 REPLIES 5
Eric Antunes
Honored Contributor

Re: limit system log file sizes

Hi,

I don't think you can limit their size but you may trim them periodically on SAM.

Eric
Each and every day is a good day to learn.
Muthukumar_5
Honored Contributor

Re: limit system log file sizes

Do you want to limit the log files which log sam information's then,

go to

SAM --> options --> SAM Log Options... --> SAM Log options -->
Trim SAM Log: [ Automatically ->]
Maximum SAM Log Size (bytes): 200000

That is all. You can view help for more information's there.
Easy to suggest when don't know about the problem!
Jeff_Traigle
Honored Contributor

Re: limit system log file sizes

No built-in functionality to do this that I can think of offhand. A couple of possibilities:

1. Create a cron job to periodically trim log files you are concerned about. This will, of course, be a time-based method, but if you know approximately how quickly your logs fill to the size you want to keep them under, it works well enough.

2. See if you can find a port of logrotate (or similar utility) that you can configure to rotate logs based on their size.
--
Jeff Traigle
Brian Markus
Valued Contributor

Re: limit system log file sizes

Check this link:

http://forums1.itrc.hp.com/service/forums/parseCurl.do?CURL=%2Fcm%2FQuestionAnswer%2F1%2C%2C0x836cc1c4ceddd61190050090279cd0f9%2C00.html&admit=716493758+1095359678622+28353475

There is a really cool log rotate script attached to one of the responces.

-Brian.
When a sys-admin say's maybe, they don't mean 'yes'!
Bill Hassell
Honored Contributor
Solution

Re: limit system log file sizes

HP-UX (and virtually all other flavors of Unix) has no facility to limit logfiles. Most of the logfiles are generated by processes that simply write to the file and there is no code to trim the older entries. An exception to this is MeasureWare. I've attached a logtrim script which you can customize and add to cron to run every day or so. The functions do all the work, and you configure the logfile actions at the end of the script.


Bill Hassell, sysadmin