Re: How to use Procmail to remove messages from server after x number of days

LuKreme <[email protected]>
Newsgroups gmane.mail.procmail
Message-ID <[email protected]>
On 1-Mar-2011, at 14:35, Richard Ball wrote:
> 
> On 1-3-2011 16:31, LuKreme wrote:
>> On 1-Mar-2011, at 12:23, Tim Rice wrote:
>>> On 3/2/2011 1:12 AM, LuKreme wrote:
>>>> find /home/*/Maildir/.SPAM/{cur,new} -type f -ctime +7 -delete
>>> find /usr/boxes/rice/computerstuff.net/old/ -type f -mtime +10 -exec rm {} \;
>>> 
>>> I was going to test this on a new test box but after seeing your post I'm curious about the -ctime and -delete vs -mtime and -rm? Also, How can I be sure I'm using Maildir and not Mboxes?
>> ctime is the create time on the file, mtime is the modified time. Since I am deleting only spam message, I don't care when the message was last looked at, if it's int hat folder and was created 7 days ago, it's gone.
>> 
>> -exec rm {} \; is simply a long way of spawning a shell and executing rm for old, OLD versions of find that don't have -delete.
>> 
>> 
> Which will break if too many files are found. (where "too many" means the length of the string of filenames exceeds the buffer length allocated for commands on the system).

I thought they fixed that in find? But regardless, I've deleted a lot of mail this way and not had a problem.

-- 
Ten Minutes ago you beat a man senseless.  He was senseless before I
beat him.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.