Re: Rotating logs

This is a discussion on Re: Rotating logs within the Apache Web Server forums, part of the Web Server and Related Forums category; -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Mon, 11 Aug 2003 11:18:12 +0200, Over K. <overk@ofir....


Go Back   Usenet Forums > Web Server and Related Forums > Apache Web Server

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 08-14-2003
Jim Richardson
 
Posts: n/a
Default Re: Rotating logs

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Mon, 11 Aug 2003 11:18:12 +0200,
Over K. <overk@ofir.dk> wrote:
> Hi.
>
> I'm running Apache 1.3.26 and using an obsolete program to rotate my
> log-files. It's giving a lot of trouble and I'm looking for a new way to
> have these log-files rotated. Does anyone have a good idea?
>


logrotate.


jim@grendel:~$ apt-cache show logrotate
Package: logrotate
Priority: important
Section: admin
Installed-Size: 132
Maintainer: Paul Martin <pm@debian.org>
Architecture: i386
Version: 3.6.5-2
Depends: libc6 (>= 2.2.5-13), libpopt0 (>= 1.6.4), cron (>= 3.0pl1-53) | anacron, base-passwd (>= 2.0.3.4)
Recommends: mailx
Filename: pool/main/l/logrotate/logrotate_3.6.5-2_i386.deb
Size: 27932
MD5sum: 6e155c4091b300bf93a2e6073870f3f5
Description: Log rotation utility
The logrotate utility is designed to simplify the administration of
log files on a system which generates a lot of log files. Logrotate
allows for the automatic rotation compression, removal and mailing of
log files. Logrotate can be set to handle a log file daily, weekly,
monthly or when the log file gets to a certain size. Normally, logrotate
runs as a daily cron job.


If you are using debian, piece of cake, I doubt it's too difficult to
set up with Redhat et al either. Works great, remember to restart apache
(gracefully) to make it write to the new logfile. My apache rotate file
looks something like this.

#Changed rotation to daily, log's too big to do weekly.
daily
# Save 10 logs
rotate 10
# touch the newfile for apache to write to
create
# compress the old logs
compress

/usr/local/apache/logs/access_log {
missingok
postrotate
/usr/local/apache/bin/apachectl graceful
endscript
}

/usr/local/apache/logs/error_log {
missingok
postrotate
/usr/local/apache/bin/apachectl graceful
endscript
}

Pretty simple really.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)

iD8DBQE/Ozcjd90bcYOAWPYRAuQNAJ0eRuKsIkv319uBan6Wr9iyXVfewQ Cg34qh
T1kTYnTkWtBbpoe/K2QmDzY=
=zcbv
-----END PGP SIGNATURE-----

--
Jim Richardson http://www.eskimo.com/~warlock

Linux, because eventually, you grow up enough to be trusted with a fork()
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 03:53 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0