Current time: 11-25-2024, 06:39 PM Hello There, Guest! (LoginRegister)


Post Reply 
Rotating Logs
Author Message
wb6vpm Offline
Junior Member
*

Posts: 80
Joined: Oct 2007
Reputation: 0
Post: #5
RE: Rotating Logs
sorry, not to do the 20 question thing, but does this also deal with the domain logs (ie /var/www/virtual/{domain_name}/logs/ directory?) as these are the main ones that are causing me my headaches.

i do appreciate all your help with this.
here is what my /etc/logrotate.d/ispcp has currently:
Code:
/var/log/httpd/users/*.log {
    weekly
    missingok
    rotate 52
    compress
    delaycompress
    notifempty
    create 640 root adm
    sharedscripts
    prerotate
        /srv/www/ispcp/engine/traffic/ispcp-srv-traff &>/var/log/ispcp/ispcp-srv-traff.log
    endscript
    postrotate
    for i in `seq 1 10`; do
        if [ -f /var/run/httpd.pid ]; then
            /etc/init.d/httpd stop > /dev/null
            sleep 5
            /etc/init.d/httpd start > /dev/null
        fi
    done
    endscript
}

/var/log/xferlog {
  daily
  rotate 7
  missingok
  compress
  delaycompress
  postrotate
    /usr/bin/killall -HUP syslogd
  endscript
}

/var/log/ftp_traff.log {
  daily
  rotate 7
  missingok
  compress
  delaycompress
  prerotate
    /var/www/ispcp/engine/traffic/ispcp-vrl-traff &> /var/log/ispcp/ispcp-vrl-traff.log
  endscript
  postrotate
    /usr/bin/killall -HUP syslogd
  endscript
}

ok, i think i have it figured out (assuming as asked above that this does what I was looking for):
Code:
/var/log/apache2/users/*.log {
  weekly
  missingok
  rotate 52
  compress
  delaycompress
  notifempty
  create 640 root adm
  sharedscripts
  prerotate
    /var/www/ispcp/engine/traffic/ispcp-vrl-traff >/var/log/ispcp/ispcp-vrl-traff.log 2>&1
  endscript
  postrotate
    if [ -f "`. /etc/apache2/envvars ; echo ${APACHE_PID_FILE:-/var/run/apache2.pid}`" ]; then
      /etc/init.d/apache2 reload > /dev/null
    fi
  endscript
}

# Rotation for user traffic prevs
#
/var/log/apache2/backup/*.log.prev {
  size 5M
  missingok
  rotate 5
  compress
  delaycompress
  notifempty
  create 640 root adm
}

# Rotation for apache2, launching general statistics if awstats is installed
#
/var/log/apache2/*.log {
  weekly
  rotate 52
  missingok
  compress
  delaycompress
  notifempty
  create 640 root adm
  sharedscripts
  prerotate
        if [ `cat /etc/ispcp/ispcp.conf | grep -c 'AWSTATS_ACTIVE *= *yes'` = 1 ]; then
      perl /var/www/ispcp/engine/awstats/awstats_updateall.pl now -awstatsprog=/usr/lib/cgi-bin/awstats.pl >/dev/null 2>&1
    fi
  endscript
  postrotate
    if [ -f "`. /etc/apache2/envvars ; echo ${APACHE_PID_FILE:-/var/run/apache2.pid}`" ]; then
      /etc/init.d/apache2 reload > /dev/null
    fi
  endscript
}

# Rotation for ispcp-apache-logger logfiles
#
"/var/log/ispcp/ispcp-apache-logger.stderr" /var/log/ispcp/ispcp-apache-logger.stdout {
  weekly
  rotate 2
  size 10M
  missingok
  compress
  delaycompress
  notifempty
  create 640 root adm
}

/var/log/httpd/users/*.log {
    weekly
    missingok
    rotate 52
    compress
    delaycompress
    notifempty
    create 640 root adm
    sharedscripts
    prerotate
        /srv/www/ispcp/engine/traffic/ispcp-srv-traff &>/var/log/ispcp/ispcp-srv-traff.log
    endscript
    postrotate
    for i in `seq 1 10`; do
        if [ -f /var/run/httpd.pid ]; then
            /etc/init.d/httpd stop > /dev/null
            sleep 5
            /etc/init.d/httpd start > /dev/null
        fi
    done
    endscript
}

/var/log/xferlog {
  daily
  rotate 7
  missingok
  compress
  delaycompress
  postrotate
    /usr/bin/killall -HUP syslogd
  endscript
}

/var/log/ftp_traff.log {
  daily
  rotate 7
  missingok
  compress
  delaycompress
  prerotate
    /var/www/ispcp/engine/traffic/ispcp-vrl-traff &> /var/log/ispcp/ispcp-vrl-traff.log
  endscript
  postrotate
    /usr/bin/killall -HUP syslogd
  endscript
}

/var/log/httpd/users/*.log {
    weekly
    missingok
    rotate 52
    compress
    delaycompress
    notifempty
    create 640 root adm
    sharedscripts
    prerotate
        /srv/www/ispcp/engine/traffic/ispcp-srv-traff &>/var/log/ispcp/ispcp-srv-traff.log
    endscript
    postrotate
    for i in `seq 1 10`; do
        if [ -f /var/run/httpd.pid ]; then
            /etc/init.d/httpd stop > /dev/null
            sleep 5
            /etc/init.d/httpd start > /dev/null
        fi
    done
    endscript
}

/var/log/xferlog {
  daily
  rotate 7
  missingok
  compress
  delaycompress
  postrotate
    /usr/bin/killall -HUP syslogd
  endscript
}

/var/log/ftp_traff.log {
  daily
  rotate 7
  missingok
  compress
  delaycompress
  prerotate
    /var/www/ispcp/engine/traffic/ispcp-vrl-traff &> /var/log/ispcp/ispcp-vrl-traff.log
  endscript
  postrotate
    /usr/bin/killall -HUP syslogd
  endscript
}
(This post was last modified: 03-03-2011 02:01 AM by wb6vpm.)
03-03-2011 01:44 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply 


Messages In This Thread
Rotating Logs - wb6vpm - 02-26-2011, 02:55 AM
RE: Rotating Logs - RatS - 02-26-2011, 09:23 AM
RE: Rotating Logs - wb6vpm - 03-02-2011, 03:26 AM
RE: Rotating Logs - RatS - 03-02-2011, 07:49 AM
RE: Rotating Logs - wb6vpm - 03-03-2011 01:44 AM
RE: Rotating Logs - RatS - 03-03-2011, 06:19 AM
RE: Rotating Logs - wb6vpm - 03-03-2011, 06:26 AM

Forum Jump:


User(s) browsing this thread: 2 Guest(s)