Re: anacron question

View: New views
5 Messages — Rating Filter:   Alert me  

Re: anacron question

by Brian Schroeder :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

 
 
On Fri 28/08/09  1:15 PM , Phil phillor@... sent:

> Thank you for reading this.
>  
> I have a standard Mandriva system that uses anacron to periodically  
> compress various log files. I'd like to exclude /var/log/messages from this
> compressing process. How can I achieve this?
>  
> It looks like anacrontab is the answer but I'm still unsure how this  
> configuration file works.
>  
> --  
> Regards,
> Phil
 
Hi Phil,
 
I believe logrotate is what is doing this for you.
 
The relevant scripts are in /etc/logrotate.d - and the one you want is syslog.
 
You will need to break out /var/log/messages into its own section inside this
file - with the "nocompress" directive.  See  man logrotate for more details.
 
Brian.

Re: anacron question

by David Guntner-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

bschroeder@... grabbed a keyboard and wrote:

>
>
> On Fri 28/08/09  1:15 PM , Phil phillor@... sent:
>> Thank you for reading this.
>>
>> I have a standard Mandriva system that uses anacron to periodically
>>  compress various log files. I'd like to exclude /var/log/messages
>> from this compressing process. How can I achieve this?
>>
>> It looks like anacrontab is the answer but I'm still unsure how
>> this configuration file works.
>
> Hi Phil,
>
> I believe logrotate is what is doing this for you.
>
> The relevant scripts are in /etc/logrotate.d - and the one you want
> is syslog.
>
> You will need to break out /var/log/messages into its own section
> inside this file - with the "nocompress" directive.  See  man
> logrotate for more details.
Ah, perhaps I misread his message then.  I thought he wanted to stop
rotating the logs.  If not, then my bad. :-)

I think that the trick is the "compress" option.  Without that, it won't
compress.  No need to specify "nocompress" - instead, just take out the
"compress" statement.

             --Dave



signature.asc (267 bytes) Download Attachment

Re: anacron question

by Phil-22 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Fri, 28 Aug 2009 02:02:49 pm bschroeder@... wrote:
>
> I believe logrotate is what is doing this for you.
>
> The relevant scripts are in /etc/logrotate.d - and the one you want is
> syslog.
>
> You will need to break out /var/log/messages into its own section
inside
> this file - with the "nocompress" directive.  See  man logrotate for
more
> details.
>
Thanks Brian and David for your quick replies.

The man page for logrotate does make sense but the actual log file
does not help me much at all.

David's answer suggesting that I remove "/var/log/messages" from
syslog looks like it might be the answer. But before I do that it might
help if I explain what I'm trying to achieve. In the meantime I have
stopped anacron.

My ISP charges a premium if I run over my monthly allocation. I've
incurred this fee several times because KPPP does not keep an
accurate record of my Internet usage. Actually, the session usage is
accurate but the accumulated usage is not.

A few years ago (when KPPP and my modem weren't compatible) I
wrote a simple script to read my session usage from
/var/log/massages. This worked without a fault and I deleted the
message file at the end of the monthly billing period.

Perhaps KPPP is unable to accumulate it's data because the log file that
it uses is rotated or compressed?

--
Regards,
Phil


Re: anacron question

by David Guntner-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Phil wrote:

> On Fri, 28 Aug 2009 02:02:49 pm bschroeder@... wrote:
>> I believe logrotate is what is doing this for you.
>>
>> The relevant scripts are in /etc/logrotate.d - and the one you want is
>> syslog.
>>
>> You will need to break out /var/log/messages into its own section
>> inside this file - with the "nocompress" directive.  See  man logrotate for
>> more details.
>
> Thanks Brian and David for your quick replies.
>
> The man page for logrotate does make sense but the actual log file
> does not help me much at all.
>
> David's answer suggesting that I remove "/var/log/messages" from
> syslog looks like it might be the answer. But before I do that it might
> help if I explain what I'm trying to achieve. In the meantime I have
> stopped anacron.
>
> My ISP charges a premium if I run over my monthly allocation. I've
> incurred this fee several times because KPPP does not keep an
> accurate record of my Internet usage. Actually, the session usage is
> accurate but the accumulated usage is not.
>
> A few years ago (when KPPP and my modem weren't compatible) I
> wrote a simple script to read my session usage from
> /var/log/massages. This worked without a fault and I deleted the
> message file at the end of the monthly billing period.
>
> Perhaps KPPP is unable to accumulate it's data because the log file that
> it uses is rotated or compressed?
In that case, I would suggest instead of turning it off completely, you
change the period for that file to be rotated & compressed monthly.
That way, your program can keep reading it.

You can override the global settings in /etc/logrotate.conf within the
/etc/logrotate.d/syslog file, and state "monthly" (without the quotes)
among the various other statements there.

           --Dave






signature.asc (267 bytes) Download Attachment

Re: anacron question

by jpb-5 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Le vendredi 28 août 2009, Phil a écrit :

> On Fri, 28 Aug 2009 02:02:49 pm bschroeder@... wrote:
> > I believe logrotate is what is doing this for you.
> >
> > The relevant scripts are in /etc/logrotate.d - and the one you want is
> > syslog.
> >
> > You will need to break out /var/log/messages into its own section
>
> inside
>
> > this file - with the "nocompress" directive.  See  man logrotate for
>
> more
>
> > details.
>
> Thanks Brian and David for your quick replies.
>
> The man page for logrotate does make sense but the actual log file
> does not help me much at all.
>
> David's answer suggesting that I remove "/var/log/messages" from
> syslog looks like it might be the answer. But before I do that it might
> help if I explain what I'm trying to achieve. In the meantime I have
> stopped anacron.
>
> My ISP charges a premium if I run over my monthly allocation. I've
> incurred this fee several times because KPPP does not keep an
> accurate record of my Internet usage. Actually, the session usage is
> accurate but the accumulated usage is not.
>
> A few years ago (when KPPP and my modem weren't compatible) I
> wrote a simple script to read my session usage from
> /var/log/massages. This worked without a fault and I deleted the
> message file at the end of the monthly billing period.
>
> Perhaps KPPP is unable to accumulate it's data because the log file that
> it uses is rotated or compressed?
A solution would be to use the daemon logging facility of pppd with a
correctly configured  syslog.conf to log your connections in a specific log file.

See man syslog.conf and /etc/syslog.conf file as example.

JPB