procmail
[Top] [All Lists]

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

2011-03-01 15:40:44
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.


____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)de
http://mailman.rwth-aachen.de/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>