Clean up script for tmp files
mailscanner at barendse.to
Fri Feb 14 13:47:52 GMT 2014
When i run the script i get this message :
find: warning: you have specified the -maxdepth option after a non-option
argument -mtime, but options are not positional (-maxdepth affects tests
specified before it as well as those specified after it). Please specify
options before other arguments.
I tried moving the $opts to the front but that didn't help.
Where am i going wrong?
On Wed, 12 Feb 2014, Jethro R Binks wrote:
> I've run this nightly for years which may help:
> ## MailScanner, SpamAssassin and so on tend to leave files around, so this
> ## will clean up any more than $days old
> ## v2.1
> # Defined in MailScanner.conf, "Incoming Work Dir":
> # Defined in MailScanner.conf, "SpamAssassin Temporary Dir":
> # Defined in clamd.conf, "TemporaryDirectory":
> opts="-mtime +$days -maxdepth 1"
> find $SATMP -name '.spamassassin*' $opts | xargs rm -rf
> find $SATMP -name 'update_spamassassin*' $opts | xargs rm -rf
> find $MSWORK -name '[0-9]*' -type d $opts | xargs rm -rf
> find $CLAMAVTMP -name 'packlist.*' -type f $opts | xargs rm -rf
> find $CLAMAVTMP -name 'checkholddir.*' -type f $opts | xargs rm -rf
> find $CLAMAVTMP -name 'clamav-*' $opts | xargs rm -rf
> On Wed, 12 Feb 2014, Remco Barendse wrote:
>> I know the subject was discussed on the mailing list several times but i
>> didn't find the ultimate solution.
>> Does anyone have a super duper cleanup script for all the files in :
>> for files like tmp.DPhoj31724
>> for files like .spamassassin3805xUDKuUtmp
>> They are seriously clogging up my filesystem and slowing down the system.
>> I tried to script something based on the age of the file but it didn't
>> work (maybe because most are zero byte files).
>> MailScanner mailing list
>> mailscanner at lists.mailscanner.info
>> Before posting, read http://wiki.mailscanner.info/posting
>> Support MailScanner development - buy the book off the website!
> . . . . . . . . . . . . . . . . . . . . . . . . .
> Jethro R Binks, Network Manager,
> Information Services Directorate, University Of Strathclyde, Glasgow, UK
> The University of Strathclyde is a charitable body, registered in
> Scotland, number SC015263.
More information about the MailScanner