From owner-freebsd-hackers Mon Jan 13 18:05:22 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.4/8.8.4) id SAA25310 for hackers-outgoing; Mon, 13 Jan 1997 18:05:22 -0800 (PST) Received: from ocean.campus.luth.se (ocean.campus.luth.se [130.240.194.116]) by freefall.freebsd.org (8.8.4/8.8.4) with ESMTP id SAA25297 for ; Mon, 13 Jan 1997 18:05:18 -0800 (PST) Received: (from karpen@localhost) by ocean.campus.luth.se (8.7.5/8.7.3) id DAA12321; Tue, 14 Jan 1997 03:07:06 +0100 (MET) From: Mikael Karpberg Message-Id: <199701140207.DAA12321@ocean.campus.luth.se> Subject: Cyclic filesystem (WAS: Re: truss, trace ??) To: brian@awfulhak.demon.co.uk (Brian Somers) Date: Tue, 14 Jan 1997 03:07:05 +0100 (MET) Cc: hackers@freebsd.org In-Reply-To: <199701140114.BAA11572@awfulhak.demon.co.uk> from Brian Somers at "Jan 14, 97 01:14:49 am" X-Mailer: ELM [version 2.4ME+ PL22 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk According to Brian Somers: > > > On Sun, 12 Jan 1997, Mikael Karpberg wrote: > > > > > Yeah, the cyclic file type is (stupidly) missing from unix. > > > > > > [...] > > > > > > > Or? Am I completely off line here? > > > > > > No you aren't. I was thinking on it for years... but > > > not enough hacking skills to do it actually. > > > > Cyclic file types imply record orientation. > [.....] > > Unless of course you don't mind having a truncated line at the start of > your log ;) > > This (IMHO) would be more "natural", 'cos there shouldn't be any "record" > knowledge at that level. I for one couldn't care less how good the implementation is. I would just like a nice efficient way of making any logfile max out at a certain size, plus minus a little. I think you could just say that when you filled one block (no matter what blocksize you run on the disk) and you need to add a new one to the file, just grab the first block, remove it from the front, clear it, append it to the end and start filling in data. Mininum cyclic filesize, two blocks. Always cut at full blocksizes. No matter what you might think of this, in terms of uggliness of such a hack, I think it would be a really nice extention to the normal file system, if it could be done, or as a new file system which is basically an FFS/UFS (whatever it is we use) with the modification of a file being able to be set cyclic on it. I mean, it's not a completely "clean" way of doing it, but it would suffice to keep log and debug files from filling filesystems, which is enough. If you logfile is about 10MB, do you care if it's 10000000 bytes or 10345620 bytes? Not very often. So... would this be hard to do, if you did it in the not-so-perfect, but easy way I described? /Mikael