#! /bin/sh
# Copyright 2016, 2017, 2019, Cumulus Networks, Inc.  All rights reserved.
# called from rsyslogd if syslog, clagd.log ptmd.log, or switchd.log
# grow too big (normally set to twice the normal limit in logrotate.d
# config files).

# If an argument is passed, and it exists as a pathname, use that
# as the logrotate -f argument, otherwise use /etc/logrotate.conf

PATH=/sbin:/usr/sbin:/usr/bin:/usr/sbin:$PATH

if [ -n "$1" -a -e "$1" ]; then
    conf="$1"
else
    conf=/etc/logrotate.conf
fi

logger -t logrotate -p notice Rotating logs because size exceeded. Using config "$conf"

logrotate -f $conf
