Found 385 messages waiting

Scott Silva ssilva at sgvwater.com
Wed Oct 18 16:30:54 IST 2006


Denis Beauchemin spake the following on 10/18/2006 7:46 AM:
> Mevershosting.nl a écrit :
>> Mike, list,
>>
>> This is the script i use, i doesnt delete files but renames them. You
>> could stop mailscanner first in the script before running this, but i
>> found it doesnt really make a differance.
>>
>> snip
> I use the following one-liner in root's crontab to remove files that
> don't have today's date (uses bash syntax on a RHEL 4 system):
> 19 9 * * * cd /var/spool/mqueue.in/ && /bin/rm -f $(/bin/ls -l
> /var/spool/mqueue.in/[dqt]* 2>/dev/null | /bin/grep -v "$(/bin/date
> '+\%b \%e')"|/bin/awk '{print $NF}') 2>/dev/null
> 
> Denis
> 
It would be better to use something that goes back at least the number of days
your system will retry for, something like;

find /var/spool/mqueue.in -type f -mtime +3 -print
to display orphaned files and
find /var/spool/mqueue.in -type f -mtime +3 -print | xargs rm -f
to delete them if your queue return is set to 3 days.


-- 

MailScanner is like deodorant...
You hope everybody uses it, and
you notice quickly if they don't!!!!



More information about the MailScanner mailing list