Archive for April 1st, 2008

pspipegrep-copia.pngWhat does ‘grep’ mean?

 

The Wikipedia entry for grep states:

grep is a command line utility originally written for use with the Unix operating system.

The name comes from a command in the Unix text editor ed that takes the form:

g/re/p

This means “search globally for matches to the regular expression re, and print lines where they are found”.

Simple como deben ser las utilidades

#vi /etc/logrotate.d/apache2

/var/log/apache2/*.log { weekly missingok
rotate 52
compress
delaycompress
notifempty
create 644 root adm
sharedscripts
prerotate
su hscsp -c ‘/usr/local/awstats/wwwroot/cgi-bin/awstats.pl -config=intranet.hscsp -update’
endscript
postrotate
if [ -f /usr/local/apache2/logs/httpd.pid ]; then
/etc/init.d/apachectl restart > /dev/null
fi
endscript
}

Con esta sencilla configuracion del logrotate matamos dos pajaros de un tiro:

  1. Hacemos la rotacion del fichero de logs y dejamos la copia comprimida.
  2. Antes de hacer la rotacion de logs nos aseguramos de actualizar las estadisticas del awstats.

Y a disfrutar del calorcillo que empieza a hacer estos dias.