On 17/06/06, Teresa and Dale <[EMAIL PROTECTED]> wrote:
Richard Broersma Jr wrote:

>I was wondering if anyone could point me to the conf file to turn on log 
rotation for my
>emerge.log.

Here is a sample of the file:

> /var/log/http-replicator.log {
>     size 10k
>     missingok
>     copytruncate
>     compress
> }


That is for http-replicator and the file is named the same.  I guess the
name doesn't matter really.

Well, the name has to reflect *exactly* the path and file  you intend to rotate.

I'm not sure but I think you need a cron job to run it to.  Not real sure.

There's two entries in logrotate.conf, a generic one:
==========================
# rotate log files weekly
#monthly
weekly
#daily
==========================

and a per file one, e.g.:
==========================
# when /var/log/user.log gets big
/var/log/user.log
{
   rotate 1
   monthly
   size=1M
}
==========================

Now, if you add logrotate in you /etc/make.conf it will be taken into
account when new apps are created and relevant files and entries will
be added in /etc/logrotate.d by those apps that are logrotate aware.
This is from mine:
==========================
# ls -la /etc/logrotate.d
total 21
drwxr-xr-x  2 root root  184 Jun  4 12:37 .
drwxr-xr-x 73 root root 5144 Jun 18 10:38 ..
-rw-r--r--  1 root root    0 Jan 21 02:33 .keep
-rw-r--r--  1 root root  145 Feb 14 19:59 acpid
-rw-r--r--  1 root root   79 May  6 12:13 hibernate-script
-rw-r-----  1 root root  191 Mar  2 20:26 privoxy
-rw-r--r--  1 root root  342 Jan 22 20:21 syslog-ng
==========================

Of course, if there is a file created for an application in
/etc/logrotate.d there's no need for a manual entry in
/etc/logrotate.conf as it will be a duplicate and lead to errors which
will invariably appear in /root/dead.letter.

HTH.
--
Regards,
Mick
--
gentoo-user@gentoo.org mailing list

Reply via email to