Hi,

As my mail folders are currently just over half a GIG I have an urgent need 
to do something to compact them. This is the idea I have at present but have 
no idea if I am even vaguely on the right track here.

I am looking for a script that will automatically once a month scan through 
my mail folders and remove all messages older than 3 months and then make a 
backup of everything that is left which can be burnt to CD.

I can't see any way of doing this directly in Kmail. I have looked in the 
mail folders with vi and have been able to delete messages with that and have 
had no problems especially if I delete the indexes and allow Kmail to rebuild 
them when it restarts. This leads me to believe that what I need is a script 
file that
1) Checks that Kmail is not open and if it is closes it.
2) Deletes the index files from /home/user/Mail
3) Grep looking for something like Date: Month 2001
4) Delete mail by clever method not yet devised.
5) Start Kmail to automatically rebuild the indexes
6) Tar -cvf monthly.backup.tar /home/user/Mail

Will it work and is there an easier way?


-- 
Regards
Richard
---------------------------------------------
There is hardly anything that some man cannot make a little worse and sell a 
little cheaper.  Ruskin

Reply via email to