On Wed, Jan 22, 2003 at 09:48:33PM +0100, Daniel Fabian wrote: | Hi, | | I'm trying to find an easy way to logrotate apache logfiles. The logfiles | are created by cronolog, one in a day. | | CustomLog "|/usr/sbin/cronolog | /wwwhome/customer1/logs/www.customer1.tt-%Y-%m-%d.log" combined | ErrorLog "|/usr/sbin/cronolog | /wwwhome/customer1/logs/www.customer1.tt-%Y-%m-%d.err" | | And that for a couple of houndred virtual domains. I want to keep 7 days | worth of logfiles, where every one but the current is compressed by a zip | program (not gzip). After 7 being 7 days old, the logfiles should be | deleted. | | Is there an easy way to do that using the logrotate program?
Yeah, this should give you a start : /wwwhome/*/logs/www.*.log /wwwhome/*/logs/www.*.err { daily rotate 7 #notifempty nocompress create 640 root adm nosharedscripts postrotate /etc/init.d/apache reload > /dev/null endscript } The last thing you have to do is write a script that will compress the files using the "zip" program of your choice and call it from the postrotate script. You'll have to handle the delaycompress feature yourself in that script. -D -- Many are the plans in a man's heart, but it is the Lord's purpose that prevails. Proverbs 19:21 http://dman.ddts.net/~dman/
msg26029/pgp00000.pgp
Description: PGP signature