1830223 Members
1454 Online
109999 Solutions
New Discussion

Re: Logrotate

 
Joe Profaizer
Super Advisor

Logrotate

Thinking about implementing logrotate but wanted the forum's expert opinion on it beforehand.

Looking for opinions on usage and/or example scripts, links, etc.... for HP-UX v11.



Thanks,

..Joe
4 REPLIES 4
I_M
Honored Contributor

Re: Logrotate

hi

Why don't you check
http://www.introcomp.co.uk/examples/logrotate.html
before you start to invent the wheel one more time.

Good luck
Jeffrey S. Sims
Trusted Contributor

Re: Logrotate

Joe,

Here is another url for you to check out
http://www.interhack.net/projects/rotatelog/
it's another log rotating tool, works pretty well for me and easily configured.

Hope it helps.
Bill Thorsteinson
Honored Contributor

Re: Logrotate

I run logrotate from the porting center. It makes
life a lot easier as logs
don't grow out of control.

HP-UX 10.20 rotates a couple of logs on reboot. This makes
following log history a bit
difficult for these logs.

I combine this with logcheck
to scan through the log for
items I should be aware of.
Jairo Campana
Trusted Contributor

Re: Logrotate

for implementing logrotate in linux you have configured /etc/logrotate.d
for rotate of log apache configured:
/var/log/httpd/access_log /var/log/httpd/agent_log /var/log/httpd/error_log /var/log/httpd/referer_log {
missingok
sharedscripts
postrotate
/bin/kill -HUP `cat /var/run/httpd.pid 2>/dev/null` 2> /dev/null || true
endscript
}

posrotate or prerotate
defeat before executing something you can write scrip tor commandos in these lines

in /etc/cron.daily or cron.hourly
Copy the file logrotate that contains the following thing

!/bin/sh

/usr/sbin/logrotate /etc/logrotate.conf
chmod 500 logrotate.conf


and logrotate.conf contains the following:
# see "man logrotate" for details
# rotate log files weekly
weekly

# keep 4 weeks worth of backlogs
rotate 4

# create new (empty) log files after rotating old ones
create

# uncomment this if you want your log files compressed
#compress

# RPM packages drop log rotation information into this directory
include /etc/logrotate.d

# no packages own wtmp -- we'll rotate them here
/var/log/wtmp {
monthly
create 0664 root utmp
rotate 1
}
legionx