#!/bin/sh
# THIS FILE IS AUTOMATICALLY DISTRIBUTED BY PUPPET.  ANY CHANGES WILL BE
# OVERWRITTEN.

# Removes corrupted entries from /var/lib/logrotate/status.hourly.
. /usr/local/lib/logrotate/clean_status_file_hourly.sh

OUTPUT=$(nice -n19 /usr/sbin/logrotate -f /etc/logrotate-hourly.conf -s /var/lib/logrotate/status.hourly 2>&1)
EXITVALUE=$?
if [ $EXITVALUE != 0 ]; then
    /usr/bin/logger -t logrotate "ALERT exited abnormally with [$EXITVALUE]"
    echo "${OUTPUT}"
fi
exit $EXITVALUE
