LOGROTATE

Adicione a entrada ao final do arquivo logrotate.conf

vi /etc/logrotate.conf

/dados/logs/201.76.222.12.log {
  compress
  compresscmd /bin/bzip2
  compressext .bz2
  size 48M
  rotate 3
}

# Utilize * para rotacionar todos arquivos/diretórios

/dados/*/* {
  compress
  size 500k
}

TESTANDO:

logrotate -d /etc/logrotate.conf

ls /dados/201.76.222.12/
CLIENTE-201.76.222.12-2007-03-26.log.1.bz2
CLIENTE-201.76.222.12-2007-03-26.log.2.bz2
CLIENTE-201.76.222.12-2007-03-26.log.3.bz2

*logrotate por padrao fica confugurado no cron para rodar 1 vez ao dia

more /etc/cron.daily/logrotate

more /etc/crontab
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s