Best way to measure sendmail queue depth?

Lars Kristiansen lars+lister.mailscanner at adventuras.no
Mon Jun 19 18:44:51 IST 2006


Julian Field skrev:
>
>
> Stephen Swaney wrote:
>> Absolutely. That's why I recommend running:
>>
>> find /var/spool/mqueue.in -mmin +120 -exec ls -l {} \; | more
>>   
> If you are doing this frequently, or expect to get quite a lot of 
> files listed, then this will be faster:
> find /var/spool/mqueue.in -mmin +120 -print | xargs ls -l | more
> as it will run the fewest "ls" processes possible, whereas the 
> previous version will run 1 "ls" for each file output.
>
> Using xargs makes a huge difference when you are doing an operation on 
> a lot of files using your "find" command.
Be careful with what you wish for when using xargs.
Some versions of xargs want to run once with empty argument if there is 
no match.
If you do rm-rf thing with a path first then...pfft, rm that path.

If your version of xargs has a '--no-run-if-empty' -option, that option 
should be used.

It is not polite to ask how I know all this.
-- 
Regards from Lars



More information about the MailScanner mailing list