"Robert Menschel" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> DG> cd /home
> DG> for i in */Maildir/.Spam ; do
> DG> find $i/{new,cur} -type f -mtime +7
> DG> done | xargs -l -i rm -f
>
> DG> The find part seems to ID all the older messages, but xargs doesn't
seem to
> DG> be removing them. Any ideas? Or a better approach?
>
> I would replace your four lines with one:
> > find /home/Maildir/.Spam/{new,cur} -type f -mtime +7 -print -exec rm {}
\;
> (remove the -print if you don't want a listing of the files being
> deleted)
find /home/Maildir/.Spam/{new,cur} -type f -mtime +7 | xargs rm
is more efficient. The find example will exec rm for each file, whereas
xargs will call rm with as many arguments as it can.
Cheers,
John