[YBA] No cyclical file in Linux?
Omer Zak
w1 at zak.co.il
Tue Mar 2 00:38:49 IST 2010
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.
--
For the average human female, a cockroach is merely another name for a
walking turd.
My own blog is at http://www.zak.co.il/tddpirate/
My opinions, as expressed in this E-mail message, are mine alone.
They do not represent the official policy of any organization with which
I may be affiliated in any way.
WARNING TO SPAMMERS: at http://www.zak.co.il/spamwarning.html
More information about the Linux-il
mailing list