On 7-Jun-2010, at 12:53, Michelle Konzack wrote:
> 
> The current version of the script is using "formail" to  get  the  Date:
> header and move the messages accourting  to  its  config...  As  I  have
> writen already it is I/O intensive and now I like to use a database  for
> the messages which where already accesses to get it  faster  runing  and
> lesser disk I/O.

That sounds really heavy. This is what I wrote

#!/bin/bash

# Archive monthly folders in the pattern YYYY-MM to the YYYY Maildir 
# after they are 31 days old.

MDIR="$HOME/Maildir"
YEAR=`/usr/local/bin/gnudate -d "last month" '+%Y'`

for i in `find $MDIR -maxdepth 1 -name ".*$YEAR" | grep -v Archive`
do
  echo -n "Processing $i..."
  find $i-*/cur -type f -ctime +31 -exec mv {} $i/cur/ \;
  echo "done."
done


Requires that the year folder exists first, but that's a feature for my use.

It's bloody fast.

-- 
I know that you believe you understand what you think I said but I am
not sure you realize that what you heard is not what I meant.


------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
courier-users mailing list
[email protected]
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users

Reply via email to