Summary: How to run a script from procmail after a mail retrieval
session is complete.
I want to run a script after all mail is retrieved and sorted (in a
given session). What I'm after is to use the "backup" scheme from
`man promailex'
:0 c backup
:0 ic
| cd backup && rm -f dummy `ls -t msg.* | sed -e 1,32d`
But keeping about 700 messages. I've edited the recipes so they work
for me like so:
:0 c
backup/.
:0 ic
| cd backup && rm -f dummy `ls -t [0-9]* | sed -e 1,700d`
This is very slow ... it runs on each message. Watching the `top'
util I see lots of activity, and a few zombies coming up and dying
(ls, sh,) So I tried using the TRAP var in .procmailrc by assigning a
script to it like:
TRAP=/path/scr
Where scr is :
#! /bin/sh
cd backup && rm -f `ls -t [0-9]* | sed -e 1,700d`
This is also very slow and also gets run on each meassage.
Is there a VAR that only comes into play when session is over?
Or some other way to run a script from procmail that runs after all
retrieval and sorting is done, so that the script runs only once?