Feature, maybe misfeature

Julian Field mailscanner at ecs.soton.ac.uk
Mon Sep 16 20:07:14 IST 2002


At 03:10 14/09/2002, you wrote:
> >> > What I haven't got written yet is a "spamsweeper" script which
> >> lazily runs in the background at a low 19 nice priority all the
> >> time, going through all of the .spam files and deleting any message
> >> older than x days.
> >>
> >> Such a thing already exists; I noticed it in the Debian package
> >> listing the other week. I'm afraid I can't remember what it's called
> >> though.
> >
>I made one when I was trying to learn Python. I use it to delete
>everything recursively in the quarantine dir older than ten days. You can
>do the same thing though with one line and "find".

As no-one seems to have posted anything, how about a line like this which
will delete all files under the current directory more than 14 days old:
   find . -type f -mtime +14 -print | xargs rm -f
   rmdir */*
   rmdir *
The "rmdir" commands will only succeed on empty directories, they don't
delete directories that have anything in them.
--
Julian Field                Teaching Systems Manager
jkf at ecs.soton.ac.uk         Dept. of Electronics & Computer Science
Tel. 023 8059 2817          University of Southampton
                             Southampton SO17 1BJ



More information about the MailScanner mailing list