[Mailman-Developers] script

Phil Barnett philb at philb.us
Wed Sep 3 04:53:04 EDT 2003


On Wednesday 20 August 2003 11:35 pm, Phil Barnett wrote:
> Has anyone created a script they'd like to share that kills off the sobig
> stuff sitting on hold?
>
> I'll make one but if there's one already out there, it'd save me some time.
> I'm leaving on vacation Friday night. Lots to do 'till then...

In the grand tradition of replying to myself...

Here is the script I cobbled up.

It deletes the worst of the muck. I let cron run it hourly. Watch the wrap. 
All lines should start with /bin/grep.

*******************

45 * * * * /home/mailman/data/cleanup.sh

******************

#! /bin/bash

cd /home/mailman/data

/bin/grep -H -m 1 -l -i '6.00.2600.0000' *.txt | /usr/bin/xargs rm  >/dev/null 
2>&1
/bin/grep -H -m 1 -l -i 'nigeria' *.txt | /usr/bin/xargs rm >/dev/null 2>&1
/bin/grep -H -m 1 -l -i 'winning notification' *.txt | /usr/bin/xargs rm 
>/dev/null 2>&1
/bin/grep -H -m 1 -l -i 'Subject: Invalid address' *.txt | /usr/bin/xargs rm 
>/dev/null 2>&1
/bin/grep -H -m 1 -l -i 'Subject: Warning! Virus found in message from you!' 
*.txt | /usr/bin/xargs rm >/dev/null 2>&1
/bin/grep -H -m 1 -l -i 'INTRODUCTORY OFFER' *.txt | /usr/bin/xargs rm 
>/dev/null 2>&1
/bin/grep -H -m 1 -l -i 'Subject: Undeliverable' *.txt | /usr/bin/xargs rm 
>/dev/null 2>&1
/bin/grep -H -m 1 -l -i 'Subject: PRECIOS DE TRANSFERENCIA' *.txt | 
/usr/bin/xargs rm >/dev/null 2>&1
/bin/grep -H -m 1 -l -i 'Subject: PROGRAMA  MEDICO' *.txt | /usr/bin/xargs rm 
>/dev/null 2>&1
/bin/grep -H -m 1 -l -i 'Amalgamated Bank of South Africa' *.txt | 
/usr/bin/xargs rm >/dev/null 2>&1
/bin/grep -H -m 1 -l -i 'Prescription Weight Loss' *.txt | /usr/bin/xargs rm 
>/dev/null 2>&1
/bin/grep -H -m 1 -l -i 'Subject: URGENT ASSISTANCE' *.txt | /usr/bin/xargs rm 
>/dev/null 2>&1
/bin/grep -H -m 1 -l -i 'Subject: EXPO CAPACITATE EMPRESARIAL' *.txt | 
/usr/bin/xargs rm >/dev/null 2>&1
/bin/grep -H -m 1 -l -i 'Subject: DONATION FOR THE LORD' *.txt | 
/usr/bin/xargs rm >/dev/null 2>&1
/bin/grep -H -m 1 -l -i 'Subject: ALERT:' *.txt | /usr/bin/xargs rm >/dev/null 
2>&1
/bin/grep -H -m 1 -l -i 'Subject: your opinion is worth money' *.txt | 
/usr/bin/xargs rm >/dev/null 2>&1


******************


-- 

Democracy is two wolves and a lamb voting on what to have for
lunch. Liberty is a well-armed lamb contesting the vote.




More information about the Mailman-Developers mailing list