1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
# Inspired by
# https://stackoverflow.com/questions/17402464/how-to-create-logrotate-in-linux
# We don't use "create", so that codeigniter will create itself the new log file
# with the correct header in it (if we create the file, the header won't be in it)
/var/log/php-codeigniter-framework/log.log {
daily
missingok
rotate 14
compress
delaycompress
notifempty
#create 644 www-data www-data
sharedscripts
dateext
dateformat -%Y-%m-%d-%s
extension .php
postrotate
if invoke-rc.d apache2 status > /dev/null 2>&1; then \
invoke-rc.d apache2 reload > /dev/null 2>&1; \
fi;
endscript
prerotate
if [ -d /etc/logrotate.d/httpd-prerotate ]; then \
run-parts /etc/logrotate.d/httpd-prerotate; \
fi; \
endscript
}
|