procmail
[Top] [All Lists]

Re: Unusual Msgs Message

2000-01-03 04:22:44
On Sat, 1 Jan 2000 21:09:00 -0600 (CST), "David W. Tamkin"
<dattier(_at_)Mcs(_dot_)Net> wrote:
or you might want procmail to skip the deletion if one is already
in progress:

  :0c
  backup
  :0aci
  * ? lockfile -r0 backup/.lock # If at first you don't succeed, screw it.
  | cd backup && rm -f `ls -t msg.* | sed 1,32d` .lock

If there's a way to do the latter with procmail's internal locking
instead of using the lockfile executable, will someone please post
it?

Veterans of this list may wish to skip the following boring old rant.

My recommendation would be to instead simply save to a directory, and
take care of the pruning of old backups via a cron job or something.

If your system already has a GFR (Grim File Reaper) process which
periodically removes old stuff from /tmp, you might even get away by
simply storing things there and let the GFR take care of getting rid
of the old files.

On the other hand, some admins get nervous when users start taking
advantage of /tmp too much, because various more or less important
things will stop working if you manage to fill up /tmp. Perhaps there
is a /scratch or /var/tmp or something you should be using instead.
Ask around.

What I do, for some things, is simply add to an mbox file in my own
directory under /scratch, and have a cron job rename those mbox files
at midnight so the old one becomes foo-datestamp and procmail will
create a new foo the next time a message for that folder comes in.
Local admins have set up a process which removes from /scratch
everything older than x (dunno what x is exactly, to be frank) when it
fills up over a certain percentage.

/scratch implies that this is a disk which may be taken out of
service, might get reformatted, might crash and not have backups,
whatever, at any time, but for casual backups, it's good enough.

If you need to do the pruning of old files yourself, man find. And go
get GNU find -- you'll be glad you did.

Hope this helps, and happy new 20%4#$%%~~~NO CARRIER

/* era */

-- 
 Too much to say to fit into this .signature anyway: <http://www.iki.fi/era/>
  Fight spam in Europe: <http://www.euro.cauce.org/> * Sign the EU petition

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