You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

13 lines
366 B

  1. #!/bin/sh
  2. # Clean non existent log file entries from status file
  3. cd /var/lib/logrotate
  4. test -e status || touch status
  5. head -1 status > status.clean
  6. sed 's/"//g' status | while read logfile date
  7. do
  8. [ -e "$logfile" ] && echo "\"$logfile\" $date"
  9. done >> status.clean
  10. mv status.clean status
  11. /usr/sbin/logrotate -v -s /var/lib/logrotate/status /etc/logrotate.conf