# alpha-asterisk — size cap for Asterisk's *.log files (messages.log, security.log).
#
# Debian's /etc/logrotate.d/asterisk only knows the OLD file names (messages, full,
# debug, *_log). logger.conf on this box writes messages.log / security.log, so they
# NEVER rotated: a SIP scanner that fail2ban failed to block filled 20 GB in days
# (2026-10-08). /etc/cron.d/alpha-logcap runs this hourly, so `maxsize` bites long
# before the nightly logrotate timer would.
/var/log/asterisk/*.log {
    su asterisk asterisk
    daily
    maxsize 200M
    rotate 7
    compress
    delaycompress
    missingok
    notifempty
    sharedscripts
    create 0644 asterisk asterisk
    postrotate
        /usr/sbin/asterisk -rx 'logger reload' >/dev/null 2>&1 || true
    endscript
}
