Hi, every once in a while 'logwatch' does not create a daily log. E.g.: The file '/var/log/logwatch/2019-01-26' exists, but size = 0 Bytes. The same happened in February 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 is created, everything looks ok. For testing, I changed the conjob for logwatch from "01 0 * * *" to "03 0 * * *" but tonight 'logwatch' did it again: "No (or only partial) logs exist for the day queried: /var/log/logwatch/2019-03-31 could not be opened." Best, Matthias
Can you enable cron logging when it calls this command?
Is there a way to enable cron logging ONLY for this specific 'logwatch' command? I only know how to enable cron logging completely and this leads to a whole lot of entries in the log...
(In reply to Matthias Fischer from comment #2) > Is there a way to enable cron logging ONLY for this specific 'logwatch' > command? > > I only know how to enable cron logging completely and this leads to a whole > lot of entries in the log... No, it is either on or off. And yeah, we have jobs that launch every minute :)
FYI: I changed the conjob for logwatch from "01 0 * * *" to "04 0 * * *". The system is now running: "Up: 42 days, 16:36" Problem didn't show up again. Best, Matthias
So why does 4am work, but 3am does not?
On 20.08.2019 20:15, IPFire Bugzilla wrote: > https://bugzilla.ipfire.org/show_bug.cgi?id=12036 > > --- Comment #5 from Michael Tremer <michael.tremer@ipfire.org> --- > So why does 4am work, but 3am does not? > I have no (solid) reason, sorry. The only reason I can think of is - as you wrote earlier (development-list, 01.04.2019, Re: Logwatch (randomly) skipping days => Feature!?): "Is it possible that this conflicts with the logrotate job that is launched at the same time and logwatch tries to read files that are being rotated away?" After the last ~45 days I would say: yes... Sorry, I have no more than that right now. Only thing I can think of could be to change starting time back to "01 0 * * *" and turn on cron logging. Hadn't the nerve to do this yet and look for the logs each day... Best, Matthias
Hmm, okay. But shouldn't it be enough then to run logwatch a couple of minutes after midnight? Logrotate should not take longer than 5 minutes - and that only when it has to compress a really really really large file.
Yep. Thats exactly what I was trying to achieve: I changed the start of 'logwatch' from "one minute after midnight" to "4 minutes after midnight". We can alter this to five minutes but I wouldn't go any further. Or did I miss something?
Okay, can you send a patch?
Done. To be sure, I set the start time to 00:05am. => https://patchwork.ipfire.org/patch/2377/ => https://git.ipfire.org/?p=people/mfischer/ipfire-2.x.git;a=commit;h=87dce260dbcb5d22b500f3c8dbe21934b52aa09b
https://blog.ipfire.org/post/ipfire-2-23-core-update-136-released