Feature Request

Patterson S.R. S.R.Patterson at SOTON.AC.UK
Fri Sep 13 15:52:49 IST 2002


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

> -----Original Message-----
> From: Rose, Bobby [mailto:brose at MED.WAYNE.EDU]
> Sent: 13 September 2002 15:04
>
> Mqueue.in cleanup...

I run the following (untidy and wasteful) bit of shell every night,
others may find it handy.  Note that the order of these operations is
important.

#!/bin/sh
# Delete zero length qf files
#echo "Deleting zero length QF files"

cd /var/spool/mqueue

for QFFILENAME in qf*; do
  if [ ! -s $QFFILENAME ]; then
    rm -f $QFFILENAME
  fi
done

cd /var/spool/mqueue.in

for QFFILENAME in qf*; do
  if [ ! -s $QFFILENAME ]; then
    rm - f $QFFILENAME
  fi
done

# Delete [A-Z]f files older than three days
#echo "Delete [A-Z]f files older than 3 days"
find /var/spool/mqueue -name [A-Z]f\* -mtime +3 | xargs rm -f
find /var/spool/mqueue.in -name [A-Z]f\* -mtime +3 | xargs rm -f

# Rename tf to qf if no qf.....
#echo "Remaning tf to qf where no qf exists"
cd /var/spool/mqueue
for i in tf*; do
  SHORTNAME=`echo $i|cut -c3-`
  if [ ! -f qf${SHORTNAME} ]; then
        mv $i qf${SHORTNAME}
  fi
done

cd /var/spool/mqueue.in
for i in tf*; do
  SHORTNAME=`echo $i| cut -c3-`
  if [ ! -f qf${SHORTNAME} ]; then
    mv $i qf${SHORTNAME}
  fi
done

# Delete df files with no qf
#echo "Deleting df files with no qf"
cd /var/spool/mqueue
for i in df*; do
  SHORTNAME=`echo $i| cut -c3-`
  if [ ! -f qf${SHORTNAME} ]; then
    rm -f $i
  fi
done

cd /var/spool/mqueue.in
for i in df*; do
  SHORTNAME=`echo $i | cut -c3-`
  if [ ! -f qf${SHORTNAME} ]; then
    rm -f $i
  fi
done

- --
Steven Patterson MSci OCP.  Tel: +44 (0)2380 595810
Electronic Information Systems Support and Development
Computing Services, University of Southampton, UK.
Public PGP Key: http://www.soton.ac.uk/~srp/pubkey.asc

-----BEGIN PGP SIGNATURE-----
Version: PGP 7.0.4

iQA/AwUBPYH7wa2fOiTs5+WvEQIH+QCgtfbOImZy99foZ2lN64qCQOSTVB4AoI/Y
jwvv4T9s0jtorXRcng4fBWj6
=EGjY
-----END PGP SIGNATURE-----



More information about the MailScanner mailing list