Loading ...
Sorry, an error occurred while loading the content.
 

Re: how to count mail on queue

Expand Messages
  • Miles Fidelman
    ... I use: /usr/bin/mailq |grep Requests Miles
    Message 1 of 12 , Apr 1, 2007
      Victor Duchovni wrote:
      > On Sat, Mar 31, 2007 at 10:12:30PM -1000, Julian Cowley wrote:
      >
      >
      >> On Fri, 30 Mar 2007, Victor Duchovni wrote:
      >>
      >>> On Fri, Mar 30, 2007 at 10:02:37AM -0700, Eric Frazier wrote:
      >>>
      >>>
      >>>>> sudo find /var/spool/postfix/deferred -type f -print | wc -l
      >>>>>
      >>> This has to stat every file and so incurs a lot of I/O, by far faster on
      >>> systems with leaf-directory optimization is:
      >>>
      >>> sudo find /var/spool/postfix/deferred/. ! -name . ! -name '?' -print | wc -l
      >>>
      >> That's pretty nice. Unless I'm missing something, looks like it can
      >> be further reduced to:
      >>
      >> sudo find /var/spool/postfix/deferred/. ! -name '?' -print | wc -l
      >>
      >>
      >
      > Provided you are willing to subtract 1 at the end, yes.
      >
      >
      I use:
      /usr/bin/mailq |grep Requests

      Miles
    • Julian Cowley
      ... I knew there was a catch. I ve found that with the GNU version of find, ? doesn t match . at the beginning of a filename, whereas on FreeBSD it does.
      Message 2 of 12 , Apr 1, 2007
        On Sun, 1 Apr 2007, Victor Duchovni wrote:
        > On Sat, Mar 31, 2007 at 10:12:30PM -1000, Julian Cowley wrote:
        > > On Fri, 30 Mar 2007, Victor Duchovni wrote:
        > > > On Fri, Mar 30, 2007 at 10:02:37AM -0700, Eric Frazier wrote:
        > > >
        > > > > > sudo find /var/spool/postfix/deferred -type f -print | wc -l
        > > >
        > > > This has to stat every file and so incurs a lot of I/O, by far faster on
        > > > systems with leaf-directory optimization is:
        > > >
        > > > sudo find /var/spool/postfix/deferred/. ! -name . ! -name '?' -print | wc -l
        > >
        > > That's pretty nice. Unless I'm missing something, looks like it can
        > > be further reduced to:
        > >
        > > sudo find /var/spool/postfix/deferred/. ! -name '?' -print | wc -l
        >
        > Provided you are willing to subtract 1 at the end, yes.

        I knew there was a catch. I've found that with the GNU version
        of find, '?' doesn't match '.' at the beginning of a filename,
        whereas on FreeBSD it does. Still, the original version works on
        both operating systems.
      • Chuck Amadi
        ... Very simple line of:: mailq | tail -1 Cheers -- Chuck Amadi ROK Corporation Limited Ty ROK, Dyffryn Business Park, Llantwit Major Road, Llandow, Vale Of
        Message 3 of 12 , Apr 2, 2007
          Victor Duchovni wrote:
          > On Sat, Mar 31, 2007 at 10:12:30PM -1000, Julian Cowley wrote:
          >
          >
          >> On Fri, 30 Mar 2007, Victor Duchovni wrote:
          >>
          >>> On Fri, Mar 30, 2007 at 10:02:37AM -0700, Eric Frazier wrote:
          >>>
          >>>
          >>>>> sudo find /var/spool/postfix/deferred -type f -print | wc -l
          >>>>>
          >>> This has to stat every file and so incurs a lot of I/O, by far faster on
          >>> systems with leaf-directory optimization is:
          >>>
          >>> sudo find /var/spool/postfix/deferred/. ! -name . ! -name '?' -print | wc -l
          >>>
          >> That's pretty nice. Unless I'm missing something, looks like it can
          >> be further reduced to:
          >>
          >> sudo find /var/spool/postfix/deferred/. ! -name '?' -print | wc -l
          >>
          >>
          >
          > Provided you are willing to subtract 1 at the end, yes.
          >
          >
          Very simple line of::

          mailq | tail -1

          Cheers

          --
          Chuck Amadi
          ROK Corporation Limited
          Ty ROK,
          Dyffryn Business Park,
          Llantwit Major Road,
          Llandow,
          Vale Of Glamorgan.
          CF71 7PY

          Tel: 01446 795 839
          Fax: 01446 794 994
          International Tel: +44 1446 795 839

          email: chuck.amadi@...

          This email is confidential to the addressee only. If you do not believe
          that you are the intended recipient, do not pass it on or copy it in any
          way. Please delete it immediately.
        Your message has been successfully submitted and would be delivered to recipients shortly.