From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matthias Fischer To: development@lists.ipfire.org Subject: Re: Logwatch (randomly) skipping days => Feature!? Date: Sun, 17 Feb 2019 13:02:58 +0100 Message-ID: In-Reply-To: <20190217103803.GA23128@tarvainen.info> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============5884609536899991335==" List-Id: --===============5884609536899991335== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hi, On 17.02.2019 11:38, Tapani Tarvainen wrote: > Hi, >=20 > 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: >=20 > # 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 yes= terday`; \ > LOGWATCH_KEEP=3D$(sed -ne 's/^LOGWATCH_KEEP=3D\([0-9]\+\)$/= \1/p' /var/ipfire/logging/settings); \ > find /var/log/logwatch/ -ctime +${LOGWATCH_KEEP=3D56} -exec= rm -f '{}' ';' >=20 > Try changing the minute value in logwatch to 02 or maybe 03 to be on the sa= fe side. Done. Changed to "03". We'll see. > Incidentally, why is logrotate being run every hour? Wouldn't daily be enou= gh? No idea. Better granularity? Best, Matthias >=20 > Tapani >=20 >=20 > On Sun, Feb 17, 2019 at 10:22:26AM +0100, Matthias Fischer (matthias.fische= r(a)ipfire.org) wrote: >>=20 >> Hi, >>=20 >> I discovered something weird: >>=20 >> >From time to time 'logwatch' does not create a daily log. >>=20 >> E.g.: >> The file '/var/log/logwatch/2019-14-26' exists, but size =3D 0 Bytes. >>=20 >> The same happened yesterday with '/var/log/logwatch/2019-02-16': >> 0 Bytes. >>=20 >> After running... >>=20 >> /usr/local/bin/logwatch > /var/log/logwatch/`date -I -d yesterday`; \ >> LOGWATCH_KEEP=3D$(sed -ne 's/^LOGWATCH_KEEP=3D\([0-9]\+\)$/\1/p' >> /var/ipfire/logging/settings); \ >> find /var/log/logwatch/ -ctime +${LOGWATCH_KEEP=3D56} -exec rm -f '{}' ';' >>=20 >> ...manually from console, file was created, everything looks ok. >>=20 >> 1. Can anyone confirm? >>=20 >> 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... >>=20 >> Best, >> Matthias >=20 --===============5884609536899991335==--