Domlog Rotation

From brokenpoet.org wiki

This is a basic framework for domlog rotation. It is difficult to achieve because you have to make sure to make exceptions for all variations on the server.

This would go in /etc/logrotate.d/httpd

/usr/local/apache/domlogs/*.*ftp_log {
   compress
   weekly
   notifempty
   missingok
   rotate 3
   sharedscripts
   postrotate
       /bin/kill -HUP `cat /usr/local/apache/logs/httpd.pid 2>/dev/null` 2> /dev/null || true
   endscript
}

/usr/local/apache/domlogs/ftpxf* {
   compress
   weekly
   notifempty
   missingok
   rotate 3
   sharedscripts
   postrotate
       /bin/kill -HUP `cat /usr/local/apache/logs/httpd.pid 2>/dev/null` 2> /dev/null || true
   endscript
}

/usr/local/apache/domlogs/*.*bytes_log  {
   compress
   weekly
   notifempty
   missingok
   rotate 3
   sharedscripts
   postrotate
       /bin/kill -HUP `cat /usr/local/apache/logs/httpd.pid 2>/dev/null` 2> /dev/null || true
   endscript
}

/usr/local/apache/domlogs/*.offset {
   compress
   weekly
   notifempty
   missingok
   rotate 3
   sharedscripts
   postrotate
       /bin/kill -HUP `cat /usr/local/apache/logs/httpd.pid 2>/dev/null` 2> /dev/null || true
   endscript
}

/usr/local/apache/domlogs/*.*ssl_log {
   compress
   weekly
   notifempty
   missingok
   rotate 3
   sharedscripts
   postrotate
       /bin/kill -HUP `cat /usr/local/apache/logs/httpd.pid 2>/dev/null` 2> /dev/null || true
   endscript
}

/usr/local/apache/domlogs/*.*ssl_data_log {
   compress
   weekly
   notifempty
   missingok
   rotate 3
   sharedscripts
   postrotate
       /bin/kill -HUP `cat /usr/local/apache/logs/httpd.pid 2>/dev/null` 2> /dev/null || true
   endscript
}

/usr/local/apache/domlogs/*.com {
   compress
   weekly
   notifempty
   missingok
   rotate 3
   sharedscripts
   postrotate
       /bin/kill -HUP `cat /usr/local/apache/logs/httpd.pid 2>/dev/null` 2> /dev/null || true
   endscript
}

/usr/local/apache/domlogs/*.net {
   compress
   weekly
   notifempty
   missingok
   rotate 3
   sharedscripts
   postrotate
       /bin/kill -HUP `cat /usr/local/apache/logs/httpd.pid 2>/dev/null` 2> /dev/null || true
   endscript
}

/usr/local/apache/domlogs/*.org {
   compress
   weekly
   notifempty
   missingok
   rotate 3
   sharedscripts
   postrotate
       /bin/kill -HUP `cat /usr/local/apache/logs/httpd.pid 2>/dev/null` 2> /dev/null || true
   endscript
}
Personal tools