Clean up script for tmp files

Paul A Sand pas at
Wed Feb 12 12:11:43 GMT 2014

* Remco Barendse <mailscanner at> [2014-02-12 06:06]:
> Does anyone have a super duper cleanup script for all the files in :
> /tmp
> for files like  tmp.DPhoj31724
> /var/spool/MailScanner/incoming/SpamAssassin-Temp
> for files like  .spamassassin3805xUDKuUtmp
>                  MailScanner.0aOrDx
>                  tmp.IKiiOy6683
> They are seriously clogging up my filesystem and slowing down the system.

Whoa, you’re right that there’s a lot of them.

Using “tmpwatch” is probably the answer if you’re using a Linux-based
system. (

On (for example) Red Hat, you can tweak the /tmp cleaning options
(and add directories like /var/spool/MailScanner/incoming/SpamAssassin-Temp)
by editing /etc/cron.daily/tmpwatch.

I’m going to do that last part myself right now…

-- Paul A Sand <pas at>
-- Information Technology / University of New Hampshire
-- Do not remove tag under penalty of federal law.

More information about the MailScanner mailing list