procmail
[Top] [All Lists]

Re: Why deosn't this work ?

1997-07-19 17:34:00
At 11:27 AM 7/19/97 -0400, Stan Brown wrote:
      In seting up my procmail configs, I ran across a recipie that sounded
      like a good idea. Here it is:



# Create a backup cache of 100 most recent messages in case of mistakes
:0 c
.backup

 :0 ic
 | cd .backup && rm -f dummy `ls -t msg.* | sed -e 1,100d`

      I just checke this file and found over 3000 messages int! Any idea
      whats wrong here?

Ah, I can't resist replying to another Stan!  :-)

My guess on this:  "ls -t msg.*" expands to a command too long for the
shell you're using to handle.  That would surprise me at 100 files, but
now that you're at 3000 files there, it's a distinct possibility.
(To make things worse, once the command fails, it will continue to fail
as more and more files pile up.)

I'll suggest deleting all those 3000 files (also, delete and recreate
the directory; you don't really want all those "holes" from the
once-existent files), and try a small number for testing... say, 3
instead of 100, then send yourself 4 test emails.  Then you should
be able to "up" this number (but not larger than your shell can
handle).

Do you have a log file?  I'd expect errors to show up there.

BTW, if you *need* more files than your shell's limit will handle,
my first guess is that you have no files other than "msg.*" in your
.backup directory anyway, and just:
        | cd .backup && rm -f dummy `ls -t | sed -e 1,100d`
might work just fine...  in fact, now that I think of it, this should
be faster anyway, since what is the point of expanding msg.* anyway?

Should the man page be changed on this?

Cheers,
Stan

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