public inbox for development@lists.ipfire.org
 help / color / mirror / Atom feed
From: Matthias Fischer <matthias.fischer@ipfire.org>
To: development@lists.ipfire.org
Subject: Re: Logwatch (randomly) skipping days => Feature!?
Date: Sun, 17 Feb 2019 13:02:58 +0100	[thread overview]
Message-ID: <b998cf0d-2cf5-61de-4f52-6b62501f7b33@ipfire.org> (raw)
In-Reply-To: <20190217103803.GA23128@tarvainen.info>

[-- Attachment #1: Type: text/plain, Size: 1996 bytes --]

Hi,

On 17.02.2019 11:38, Tapani Tarvainen wrote:
> Hi,
> 
> 1. Confirmed. Seems to happen randomly about twice a month or so.

Ok, I'm not alone. ;-)

> 2. My first guess of the cause is that as logwatch runs at
>    the same time as logrotate it causes a race condition:
> 
> # fcrontab -l|grep log
> 2019-02-17 12:32:01  INFO listing root's fcrontab
> 01 * * * *      /usr/sbin/logrotate /etc/logrotate.conf
> 01 0 * * *      /usr/local/bin/logwatch > /var/log/logwatch/`date -I -d yesterday`; \
>                 LOGWATCH_KEEP=$(sed -ne 's/^LOGWATCH_KEEP=\([0-9]\+\)$/\1/p' /var/ipfire/logging/settings); \
>                 find /var/log/logwatch/ -ctime +${LOGWATCH_KEEP=56} -exec rm -f '{}' ';'
> 
> Try changing the minute value in logwatch to 02 or maybe 03 to be on the safe side.

Done. Changed to "03". We'll see.

> Incidentally, why is logrotate being run every hour? Wouldn't daily be enough?

No idea. Better granularity?

Best,
Matthias

> 
> Tapani
> 
> 
> On Sun, Feb 17, 2019 at 10:22:26AM +0100, Matthias Fischer (matthias.fischer(a)ipfire.org) wrote:
>> 
>> Hi,
>> 
>> I discovered something weird:
>> 
>> >From time to time 'logwatch' does not create a daily log.
>> 
>> E.g.:
>> The file '/var/log/logwatch/2019-14-26' exists, but size = 0 Bytes.
>> 
>> The same happened yesterday with '/var/log/logwatch/2019-02-16':
>> 0 Bytes.
>> 
>> After running...
>> 
>> /usr/local/bin/logwatch > /var/log/logwatch/`date -I -d yesterday`; \
>> LOGWATCH_KEEP=$(sed -ne 's/^LOGWATCH_KEEP=\([0-9]\+\)$/\1/p'
>> /var/ipfire/logging/settings); \
>> find /var/log/logwatch/ -ctime +${LOGWATCH_KEEP=56} -exec rm -f '{}' ';'
>> 
>> ...manually from console, file was created, everything looks ok.
>> 
>> 1. Can anyone confirm?
>> 
>> 2. With which parameter could I change the starting time "01 0 * * *" so
>> that this doesn't happen again? I'm searching, but can't find a grip on
>> this...
>> 
>> Best,
>> Matthias
> 


  reply	other threads:[~2019-02-17 12:02 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-17  9:22 Matthias Fischer
2019-02-17 10:38 ` Tapani Tarvainen
2019-02-17 12:02   ` Matthias Fischer [this message]
2019-02-17 14:42 ` Tom Rymes
2019-02-17 15:01   ` Matthias Fischer
2019-02-18 12:38     ` Michael Tremer
2019-02-18 13:14       ` Matthias Fischer
2019-02-18 14:48         ` Michael Tremer
2019-04-01 16:28         ` Matthias Fischer
2019-04-01 16:34           ` Michael Tremer
2019-04-01 16:48             ` Matthias Fischer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b998cf0d-2cf5-61de-4f52-6b62501f7b33@ipfire.org \
    --to=matthias.fischer@ipfire.org \
    --cc=development@lists.ipfire.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox