|
|
@ -1,13 +1,12 @@ |
|
|
|
#!/bin/sh |
|
|
|
|
|
|
|
# Clean non existent log file entries from status file |
|
|
|
cd /var/lib/logrotate |
|
|
|
cd /var/lib/logrotate || return 1 |
|
|
|
test -e status || touch status |
|
|
|
head -1 status > status.clean |
|
|
|
sed 's/"//g' status | while read logfile date |
|
|
|
do |
|
|
|
sed 's/"//g' status | while read -r logfile date; do |
|
|
|
[ -e "$logfile" ] && echo "\"$logfile\" $date" |
|
|
|
done >> status.clean |
|
|
|
mv status.clean status |
|
|
|
|
|
|
|
/usr/sbin/logrotate -v -s /var/lib/logrotate/status /etc/logrotate.conf |
|
|
|
exec /usr/sbin/logrotate -v -s /var/lib/logrotate/status /etc/logrotate.conf |