Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 05 Aug 2013 00:28:33 +0100
From:      Frank Leonhardt <>
Subject:   Re: Archiving a log file
Message-ID:  <>
In-Reply-To: <>
References:  <> <> <> <>

Next in thread | Previous in thread | Raw E-Mail | Index | Archive | Help
On 04/08/2013 14:38, Terje Elde wrote:
> On 4. aug. 2013, at 12:54, Frank Leonhardt <> wrote:
>> The program writing the log is actually called flubnutz and it doesn't play nice with newsyslog, reopen handles on a signal or anything else
> Then you're out of luck for normal rotation. No matter if you rename the file, or even delete it, it'll keep writing to the same file (the moved file, not the same filename).
> I suppose your options are to either restart it to have it reopen the file, or if that's not desirable for whatever reason, look see if it'll play nice if you put a named pipe where the logfile is supposed to be. Then you can handle data as you'd like from the pipe.
> Terje
Thanks. The consensus seems to be that there is no way to do this other 
than "start from a different place". It'd be difficult for the kernel to 
trim a file from the start unless it was on a block boundary, so it's 
not implemented and explains the numerous work arounds for dealing with 
logs (fifo to log manager, signalling an application to reopen logs 
because file has changed and so on).

So I will carry on using my original bodge, happy in the knowledge that 
it may not be perfect, but there's no better method known to exist 
unless I want to implement a better truncate() in the kernel.

Regards, Frank.

Want to link to this message? Use this URL: <>