#!/bin/sh
#
# ::do_not_edit::
# ::maintainer::
#
# patched to log execution on /var/log/logrotate.log

# Clean non existent log file entries from status file
cd /var/lib/logrotate
test -e status || touch status
head -1 status > status.clean
sed 's/"//g' status | while read logfile date
do
    [ -e "$logfile" ] && echo "\"$logfile\" $date"
done >> status.clean
mv status.clean status

test -x /usr/sbin/logrotate || exit 0

logfile="/var/log/logrotate.log"
echo >>$logfile
echo "STARTED `date`" >>$logfile
/usr/sbin/logrotate -v /etc/logrotate.conf >>$logfile 2>&1
echo "STARTED `date`" >>$logfile
