# Synchronet syslog file rotation configuration
# Assumes rsyslogd is configured to log sbbs syslog output to /var/log/sbbs.log
# Assumes user/group sbbs:sbbs has been created and is used to run sbbs
# Symlink or copy this file to /etc/logrotate.d/ and edit to suit
# File must be owned by root (uid 0) and not be writeable by group/all:
# -rw-r--r-- 1 root root ... sbbs
/var/log/sbbs.log {
	weekly
	maxsize 1G
	missingok
	rotate 10
	notifempty
	create 640 sbbs sbbs
	maxage 90
	compress
	# keep the most recent rotated log (sbbs.log.1) uncompressed for grep
	delaycompress
	# rsyslogd keeps writing to the renamed file until told to reopen it
	postrotate
		if [ -x /usr/lib/rsyslog/rsyslog-rotate ]; then
			/usr/lib/rsyslog/rsyslog-rotate
		else
			pkill -HUP -x rsyslogd || true
		fi
	endscript
}
