[YBA] No cyclical file in Linux?

[YBA] No cyclical file in Linux?

Jonathan Ben Avraham yba at tkos.co.il
Tue Mar 2 09:00:22 IST 2010


Hi Omer,
Yes, that would probably work. It's better than the "poor-man's cyclical 
file" at the shell level.

Still, I'm surprised that no one has developed a file type like this.

  - yba


On Tue, 2 Mar 2010, Omer Zak wrote:

> Date: Tue, 02 Mar 2010 00:38:49 +0200
> From: Omer Zak <w1 at zak.co.il>
> To: linux-il <linux-il at cs.huji.ac.il>
> Subject: Re: [YBA] No cyclical file in Linux?
> 
> Would the following meet your need?
>
> 1. Delete the original /var/log/syslog and create a FIFO with the same
> name.
> 2. Start a process, whose stdin is the above FIFO, and which runs a
> short program or a script, whose output is a disk file.  The script
> would manage the output file as a cyclical buffer, using
> mmap()/fseek()/ftell().
>
>
> On Tue, 2010-03-02 at 00:04 +0200, Jonathan Ben Avraham wrote:
>> Hi Omer,
>> I'm looking for a file that contains the contents of the last N write
>> operations to the file where the total size of the last N operations is
>> less than or equal to some limit K.
>>
>> A cyclical buffer that has a file API and is flushed to disk (FLASH)
>> automatically at some interval or at every write would do this. Even a
>> cyclical buffer in RAM with a file API would be fine.
>>
>> I want to output syslog to this file.
>
>

-- 
  EE 77 7F 30 4A 64 2E C5  83 5F E7 49 A6 82 29 BA    ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
      - yba at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -



More information about the Linux-il mailing list