# Plan 11 B2 — logrotate config for the shared bandwidth log.
#
# Installed to /etc/logrotate.d/corasigne-bw by postinst. Rotates the
# log daily so the BandwidthRollup job (which reads .log.1) sees a
# stable, complete yesterday's-file.
#
# 7-day retention is sufficient: the rollup job runs daily and the
# data lands in account_usage. The log itself is just an intermediate
# accounting artifact.

/var/log/nginx/corasigne-bw.log {
    daily
    rotate 7
    missingok
    notifempty
    create 0640 www-data adm
    sharedscripts
    postrotate
        [ -f /var/run/nginx.pid ] && kill -USR1 `cat /var/run/nginx.pid` || true
    endscript
}
