Re: [Exim] Cleaning up msglog

Página Principal
Apagar esta mensagem
Responder a esta mensagem
Autor: Nico Erfurth
Data:  
Para: Mike Richardson
CC: exim-users
Assunto: Re: [Exim] Cleaning up msglog
Mike Richardson wrote:
> We had a problem with exiscan which meant that only the -D files
> were written to the spool directories. We think we know what the
> problem is and that moving to exiscan 4.10-17 will fix it though.
>
> However we still have lots of -D files hanging around. Will exim
> automatically clean these up at some point or not?
>
> Now I'm hoping that the answer is 'yes' because the number is 14,000
> and the size is 16GB. Otherwise I may have to get out my perl scripting...
>
> If I have to resort to the perl script how safe is it to look for
> files in msglog with a -D but which don't have a matching -H or
> entry in input and delete them? Are there likely to be any legit
> files of this type hanging around, assuming I turn off the exim
> daemon?


exim will not delete them itself.

The files CAN be legit, i.e. if a new messages comes in, and is checked
by local_scan currently.

You can try this script, it will delete all -D files older than 10
minutes, if no -H files exists for it.

You can increase the -cmin parameter to make it a little bit more secure.

#!/bin/bash
for FILE in `find input/ -cmin +10 -name '*-D' -type f`; do
   FILEX=`echo $FILE|sed -e 's/-D$/-H/'`
   echo "Checking $FILE for header ($FILEX)"
   if [ ! -e $FILEX ] ; then
     echo "Removing stale $FILE"
     rm "$FILE"
   fi ;
done