[Raw Msg Headers][Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: "resubmit" when crowded /deferred



On Tue, May 06, 2003 at 06:37:14PM +0400, Eugene Crosser wrote:
> Another smallish thing that I have in my bag is a cure for a trouble
> that happens if your "deferred" directory becomes so crowded that shell
> fails to expand "*".  It happend several times here when the server that
> provides getpwnam() information went down for some time.  After it
> happens, "resubmit" does not work anymore, forever.
> 
> I tried to make my solution as portable as I could; if you have GNU "mv"
> the same thing can be done more elegant through "xargs".

  Knowing that  a)  it isn't speed critical,  b) we want generic
  portability:

        resubmit)
            (cd $POSTOFFICE/deferred &&  \
		find . -type f -exec mv '{}' ../router/ ';')
	    ;;

  Maybe adding some name format check, but that isn't all that important.
  while we are pushing the things into the primary router input directory,
  anyway.

  I did check upon  'xargs',  too, but it isn't that trivial...  hmm..
  Or maybe:

       find . -type f -print | xargs -i -n 99 mv '{}' ../router/

  That thing is as wide-spread as find, e.g. been present since forever.

>          resubmit)
> -            (cd $POSTOFFICE/deferred && mv -i [0-9]* ../router) 2> /dev/null
> +           (cd $POSTOFFICE/deferred && \
> +           while :; do
> +               FILES=`ls -f|grep '^[0-9]'|head -1000`
> +               if [ "X$FILES" = "X" ]; then
> +                   break
> +               else
> +                   mv $FILES ../router || exit 1;
> +               fi
> +           done) 2> /dev/null
>              ;;

-- 
/Matti Aarnio	<mea@nic.funet.fi>
-
To unsubscribe from this list: send the line "unsubscribe zmailer" in
the body of a message to majordomo@nic.funet.fi