komprimieren von apache-cronolog logfiles

wir setzen cronolog für die apache ein, diese werden unkomprimiert abgespeichert:

im apache config sieht es so aus:


ErrorLog "|/usr/bin/cronolog /var/log/apache2/com.example/%Y/error_log.%Y-%m"
CustomLog "|/usr/bin/cronolog /var/log/apache2/com.example/%Y/access_log.%Y-%m" combined

bzw für das jahr 2010 und mai

/var/log/apache2/com.example/2010/access_log.2010-04

um die logfiles vom vormonat einmal im monat zu komprimieren diese script, wir nennen es cronologcompress in /etc/cron.monthly/ ablegen:

cronologcompress in /etc/cron.monthly/

#!/bin/sh
cd /var/log/apache2/
gzip */*/*-`date -d'-1 month' +'%m'`

thats it!

Sticchwörter: , , ,
Posted by: Fabian Thommen on 28. April 2010 @ 08:57
Filed under: apache,Server

Keine Kommentare »

Noch keine Kommentare

RSS Feed für Kommentare zu diesem Artikel. TrackBack URL

Hinterlasse einen Kommentar