# 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/kalkun/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
}
