| 1 | #Log rotation for apache2 launches general statistics if awstats is installed |
|---|
| 2 | /var/log/apache2/*.log { |
|---|
| 3 | weekly |
|---|
| 4 | missingok |
|---|
| 5 | rotate 52 |
|---|
| 6 | compress |
|---|
| 7 | delaycompress |
|---|
| 8 | notifempty |
|---|
| 9 | create 640 root adm |
|---|
| 10 | sharedscripts |
|---|
| 11 | prerotate |
|---|
| 12 | if [ `cat /etc/ispcp/ispcp.conf | grep -c "AWSTATS_ACTIVE = yes"` == 1 ]; then |
|---|
| 13 | /var/www/ispcp/engine/awstats/awstats_updateall.pl now -awstatsprog=/usr/lib/cgi-bin/awstats.pl &> /dev/null |
|---|
| 14 | fi |
|---|
| 15 | endscript |
|---|
| 16 | postrotate |
|---|
| 17 | if [ -f "`. /etc/apache2/envvars ; echo ${APACHE_PID_FILE:-/var/run/apache2.pid}`" ]; then |
|---|
| 18 | /etc/init.d/apache2 reload > /dev/null |
|---|
| 19 | fi |
|---|
| 20 | perl /var/www/ispcp/engine/traffic/update_logdb_apache |
|---|
| 21 | endscript |
|---|
| 22 | } |
|---|