Here is the code for appending a new message at the end of backup file.
It does not clear the old messages though. It just keeps adding the new
ones.
BACKUP=backup
LOCKFILE=backup.lock
:0c
$BACKUP
MAXBKP=25
:0i
XSTREAM=| formail -I 'From x' -zx'From' -x < $BACKUP
:0
* 1^1 XSTREAM ?? x
* $ -$MAXBKP^0
{
EXCESS = $=
TEMPBKP=/tmp/backup.$LOGNAME
OLDSHELL= $SHELL
SHELL= /bin/sh
:0wi
dummyvar=| if formail +${EXCESS}s < $BACKUP > $TEMPBKP ; \
then mv $TEMPBKP $BACKUP; \
else rm -f $TEMPBKP ; \
fi
SHELL=$OLDSHELL
}
LOCKFILE
Thanks,
I'll try to find the time to take a quick look.
/* era */
--
Stathy Touloumis, CTO - JASKE.COM 'innovative I/net'
JASKE.COM - 3555 W. Peterson Ave. Chicago IL 60659
___________________________________________________
http://www.jaske.com - info(_at_)jaske(_dot_)com - support(_at_)jaske(_dot_)com