🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.admin.peering
Article #1475

Re: Newbie question

#1475
From: Julien ÉLIE
Date: Tue, 14 Mar 2023 11:41
46 lines
3308 bytes
Hi Grant and San,

>> What about truncating the log files to X lines every Y hours or when 
>> inotify reports a size limit?
> 
> Simply truncating files without doing anything else is likely to cause 
> some corruption and / or uncontrolled disk consumption.  You can reduce 
> the size of the file on disk, but anything with an open file handle may 
> not know that the file size has shrunk and may therefore do the wrong 
> thing the next time it writes to the file.

Indeed.
FWIW, INN comes with a program doing that (scanlogs):
     https://www.eyrie.org/~eagle/software/inn/docs/scanlogs.html

"""
scanlogs invokes "ctlinnd flushlogs" to close the news and error log 
files, rename them to add .old to the file names and open fresh news and 
error logs; the active file is also flushed to disk, along with the 
history database.

By default, scanlogs rotates and cleans out the logs.  It keeps up to 
logcycles old compressed log files in pathlog/OLD (the logcycles 
parameter can be set in inn.conf).  scanlogs also keeps archives of the 
active file in this directory.
"""


> I'm curious why you want to go the inotify route as opposed to simply a 
> cron job that periodically checks the size of file(s) and takes proper 
> action if they are over a threshold (size and / or age).

Isn't it enough to run "news.daily" every day out of cron?
     https://www.eyrie.org/~eagle/software/inn/docs/news.daily.html

It performs log rotation (with scanlogs) amongst other things.

I really doubt that INN log files will fill up a 1 TB disk in one day...
but in case one wishes to check for that, I would then suggest to run 
scanlogs when inotify or a dedicated cron job checking the available 
disk space report that something should be done.

-- 
Julien ÉLIE

« C'est la goutte qui fait déborder l'amphore ! » (Assurancetourix)
Technical Details
Message-ID: <tupmht$3f2mt$1@news.trigofacile.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!apf1.newsdeef.eu!not-for-mail
References: <sXMOL.4024495$MJk2.1098149@fx06.ams4> <tuj8rs$1up7e$1@news.nnpt4.net> <tujufc$ac2$3@tncsrv09.home.tnetconsulting.net> <tuk5oe$153s$2@news.cyber23.de> <tul3qs$sdl$1@tncsrv09.home.tnetconsulting.net>

Show Full Headers
Complete Article Headers
Message-ID: <tupmht$3f2mt$1@news.trigofacile.com>
Subject: Re: Newbie question
Date: Tue, 14 Mar 2023 12:41:49 +0100
From: Julien ÉLIE <iulius@nom-de-mon-site.com.invalid>
References: <sXMOL.4024495$MJk2.1098149@fx06.ams4> <tuj8rs$1up7e$1@news.nnpt4.net> <tujufc$ac2$3@tncsrv09.home.tnetconsulting.net> <tuk5oe$153s$2@news.cyber23.de> <tul3qs$sdl$1@tncsrv09.home.tnetconsulting.net>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!apf1.newsdeef.eu!not-for-mail
Newsgroups: news.admin.peering
Organization: Groupes francophones par TrigoFACILE
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 14 Mar 2023 11:41:49 -0000 (UTC)
Injection-Info: news.trigofacile.com; posting-account="julien"; posting-host="san13-h02-176-143-2-105.dsl.sta.abo.bbox.fr:176.143.2.105"; logging-data="3640029"; mail-complaints-to="abuse@trigofacile.com"
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.8.0
Cancel-Lock: sha1:dw5+WBgqjs6HwdSM5oq2KVrc7Ms= sha256:uzUVc7saM6pps1jDto+EdaZs4Kfl6Z7pwMCrYKj882U= sha1:+CjoTfFpnMgOLFehxz+lO+axvcM= sha256:BTHTgiZoJtIZjcTV2caDm8eFx3zmL8TWZ/6jM/hQvVY=
In-Reply-To: <tul3qs$sdl$1@tncsrv09.home.tnetconsulting.net>