Logrotate, is this a proper config for what I want to do?
Posted
by
Felthragar
on Server Fault
See other posts from Server Fault
or by Felthragar
Published on 2012-10-05T07:21:20Z
Indexed on
2012/10/17
23:04 UTC
Read the original article
Hit count: 328
I started using logrotate a few days ago on a new server setup (actually three of them). My config is as follows.
/var/www/mywebsite.com/logs/*.log {
rotate 14
daily
dateext
compress
delaycompress
sharedscripts
postrotate
/usr/sbin/apache2ctl graceful > /dev/null
endscript
}
Problem is that this is putting several days of logs into the same file. For example, I've currently got a file called access.log-20121005 which has logs for Oct 3rd, Oct 4th and Oct 5th in it. Is that proper behaviour? What I want for it to do is to create one logfile for each day and keep 14 days of logs.
Any help appreciated, thanks.
© Server Fault or respective owner