This is a discussion on Re: mailq numbers within the mailing.postfix.users forums, part of the Mail Servers and Related category; On Mon, Jan 26, 2004 at 01:26:21PM +0100, Magnus B?ck wrote: > Jacques Botha wrote: > > &...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
On Mon, Jan 26, 2004 at 01:26:21PM +0100, Magnus B?ck wrote:
> Jacques Botha wrote: > > >Is their any fast way of getting the number of messages in the queue ? The > >emphasis is on fast. > > cd /var/spool/postfix > find active deferred incoming maildrop bounce hold -type f | wc -l > > Adjust queue directories to taste. > On Solaris at least, that can be messy when queue files move or disappear in the middle of the process, which can make it inconvenient to include in scripts. On large queues it's completely normal for Postfix to go about its business and deliver mail while you're running find. Ignoring stderr from find will probably give you a close enough approximation for monitoring purposes. find <queues> -type f 2>/dev/null | wc -l or for i in <queues> do printf %-10s $i find $i -type f 2>/dev/null | wc -l done cheers rob c |