I am wondering if there is a file system equivalent to a round-robin database, which for a fixed size, ages off the oldest files. It is pretty easy to implement with a simple cron job, which I have, but I assume it is a problem many people have and there is perhaps something better. I wish to set a fixed-size partition, or pool, in which older files are automatically removed, or aged-off, when the pool is full. A type of circular-buffer that would use the space left by the oldest file for the new ones, whilst preserving file integrity.
My cron solution compares disk usage to a threshold and recursively removes the oldest file until disk usage is again under the threshold. It is not perfect because one can't guarantee the threshold is low enough that it isn't overtaken between two cron iterations. It also doesn't maximize the use of the storage space because of the threshold value which tends to be predictive in nature (how much can I fill in one minute, between two iterations of crond). Two shortcomings I am hoping to improve upon.
I am looking for a more elegant solution, akin to how the round-robin database (http://linux.die.net/man/1/rrdtool) handles this transparently, but for file systems.