But I'm stuck on a few problems. I know a shell script would be easier,
but I wanted to try to do it all with procmail.
this is not always the appropriate thing to do. I would advise
against it. Write a shell script.
Q) When procmail writes to a directory and creates a unique filename, is
there an easy way to get the file name? Currently, I'm using:
Sure. The LASTFOLDER variable.
# Write out filtered message to unique file name in archive directory
:0wc
Use lockfiles!!!!
Q) My .procmailrc file is really more of a script at this point. It does
a number echos, directory listings, and file copies that should be all
completed before .procmail processes another message. This seems like a
good use for a lock file. I try, for example:
Use a global lockfile:
LOCKFILE=a_name_of_lockfile
Q) I want to purge old archived messages when the total archive uses too
much disk space. But I can't seem to get the disk space used into a var.
BLOCKS_USED=`du` <<-- this works,
BLOCKS_USED=$BLOCKS_USED[1] <<-- but this creates a null string???
Sure. Not Bourne shell syntax. use awk! (how will be left as an
exercise to the reader.
Soren