You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Bill Parker <do...@netnevada.net> on 2003/08/13 06:07:36 UTC

[users@httpd] Log Rotation, still

Hello All,

	I have apache 2.0.47 w/PHP 4.3.2 compiled for a RH 8.0 box (which works 
just fine).

Now, the issue is that I am trying to get logrotate to cycle logs in 
/usr/local/apache2/logs
(access_log, error_log), but they aren't moving:

here is what my /etc/crontab has:

SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/

# run-parts
01 * * * * root run-parts /etc/cron.hourly
02 4 * * * root run-parts /etc/cron.daily
22 4 * * 0 root run-parts /etc/cron.weekly
42 4 1 * * root run-parts /etc/cron.monthly

here is my cron output from cron.daily (runs at 0402 daily):

Aug 12 04:02:00 exoweb1 CROND[11883]: (root) CMD (run-parts /etc/cron.daily)

Here is what is in /etc/cron.daily:

00-logwatch
00webalizer
0anacron
logrotate
makewhatis.cron
rpm
slocate.cron
tmpwatch

Here is what is in logrotate:

#!/bin/sh
/usr/sbin/logrotate /etc/logrotate.conf

here is what is in /etc/logrotate.conf

# 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		<--- NOTE INCLUDE STATEMENT

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

# system-specific logs may be also be configured here.

Here is what is in /etc/logrotate.d

drwxr-xr-x    2 root     root         1024 Aug  8 11:09 .
drwxr-xr-x   53 root     root         4096 Aug 11 11:07 ..
-rw-r--r--    1 root     root          301 Aug  6 12:49 apache2
-rw-r--r--    1 root     root          174 May 22 02:21 httpd
-rw-r--r--    1 root     root          182 Aug  7  2002 named
-rw-r--r--    1 root     root           61 Sep  4  2002 rpm
-rw-r--r--    1 root     root          222 Apr  5 21:47 samba
-rw-r--r--    1 root     root           52 Nov 28  2002 snmpd
-rw-r--r--    1 root     root          228 Jun 23  2002 syslog
-rw-r--r--    1 root     root           32 Aug  7 23:45 up2date

Finally, here is what is in apache2

# logrotate script for Apache log files
compress

/usr/local/apache2/logs/*.log {
     rotate 31
     daily
#    size=100k
     sharedscripts
     dateext
#    extension old
     postrotate
     /usr/local/apache2/bin/httpd -k graceful
     /bin/mv -f *.gz /usr/local/apache2/logs/compressed
     endscript
}

What am I NOT seeing here to make these logs rotate on a daily basis?  It 
would be nice if I got some error indication back as to what is going on.

-Bill



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Log Rotation, still

Posted by Joseph A Nagy Jr <jo...@charter.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Tuesday 12 August 2003 23:07, Bill Parker wrote this in an attempt to 
be witty and informative:
<snip>
> What am I NOT seeing here to make these logs rotate on a daily basis?
>  It would be nice if I got some error indication back as to what is
> going on.

That's because the logrotate script is set for weekly. Change weekly to 
daily.

- -- 
Wielder of the mighty +1 LARTsaber of Unsubscribe Instructions At End of
Message, the +3 Clue-by-Four of No Attachments to a Mailing List, and
the -4 Shield of No Spell Checker. http://jan-jr-ent.homelinux.org
http://joseph-a-nagy-jr.homelinux.org http://mc-luug.homelinux.org/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQE/Ob0Unjt9jEvKYeARAkqFAJ9eE5ClrCZJflQ9XCD6p8M5efEtaQCfT0Rr
06Z9kwDKZq+8anSfzQCTmfA=
=FffA
-----END PGP SIGNATURE-----


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org