procmail
[Top] [All Lists]

Re: Formail deleting files

1995-10-07 10:48:50
Brock Rozen asked,

| I'm using an auto-acknowledgment system which uses a file called
| cache.ack which caches who has sent me messages that the auto-ack system
| has replied to. The only problem is that this file will just keep on
| getting bigger and I have to manually take out the old names.
|
| Is there any way to have formail (or procmail) automatically edit the
| file everytime it is accessed (unless you have a better solution) and
| edit out all the e-mail addresses that are 2 days old, thus keeping the
| file nice and small.
|
| The file format is as such:
|
| genesis(_at_)j51(_dot_)com 10/06/95
| jakel(_at_)eos(_dot_)bony(_dot_)com 10/06/95
| steinber(_at_)SLINKY(_dot_)CS(_dot_)NYU(_dot_)EDU 10/06/95

A very similar feature is already built into formail: the -rD function will
limit the size of the address cache to the size you specify.  However, the
cache will have a different format and it will clobber old entries based on
total cache size, not by ages of the individual entries.

If you wish to keep your current setup, there are other answers, such as a
cron job shortly before midnight that removes lines with past dates; I'm
assuming that an entry made at 11:50 PM Tuesday is "two days old" and there-
fore stale at 12:10 AM Thursday.

<Prev in Thread] Current Thread [Next in Thread>