mqueue.in cleanup

Randal, Phil prandal at herefordshire.gov.uk
Thu Jan 15 15:44:52 GMT 2009


I use this bash script to clean up orphsned files

 

#!/bin/bash
# clean up orphaned df* files in mqueue.in
# no known cause for these files yet.
/etc/init.d/MailScanner stop
sleep 30
dir="/var/spool/mqueue.in"
file=`find $dir -mtime +1`
for i in ${file}
do m=`basename ${i}`
j=${m:2}
if [ ! -e "${dir}/qf${j}" ]; then
mv ${i} /var/tmp/
fi
done
echo
df -hl
/etc/init.d/MailScanner restart
exit 0

Cheers,

Phil

-- 
Phil Randal | Networks Engineer 
Herefordshire Council | Deputy Chief Executive's Office | I.C.T.
Services Division 
Thorn Office Centre, Rotherwas, Hereford, HR2 6JT 
Tel: 01432 260160 
email: prandal at herefordshire.gov.uk 

Any opinion expressed in this e-mail or any attached files are those of
the individual and not necessarily those of Herefordshire Council.

This e-mail and any attached files are confidential and intended solely
for the use of the addressee. This communication may contain material
protected by law from being passed on. If you are not the intended
recipient and have received this e-mail in error, you are advised that
any use, dissemination, forwarding, printing or copying of this e-mail
is strictly prohibited. If you have received this e-mail in error please
contact the sender immediately and destroy all copies of it.

 

________________________________

From: mailscanner-bounces at lists.mailscanner.info
[mailto:mailscanner-bounces at lists.mailscanner.info] On Behalf Of Jan
Agermose
Sent: 15 January 2009 15:23
To: MailScanner discussion
Subject: mqueue.in cleanup



hi

I have a problem on my server in that mqueue.in fills with old files
that are never removed - files back one year - I think its safe to say
they will not get delivered. 

Is there som "find" command that can remove all files older than 14
dayes if its safe to do so or should I clean up in some other way? 

 

regards

Jan

 

 



More information about the MailScanner mailing list