Bill Anderson <[EMAIL PROTECTED]> wrote: > Why not use "-type f" to tell find to only show files, which does not > include directories? That is how I did it when I was using the brute > force method. Nice advantage in that you can have any amount of > hashing in a directory and still get an accurate count. On queue > directories with upwards of 100,000 files it takes about a third of a > second or less. Surely that is fast enough for such usage. ;)
Using -f requires a stat call for each file. Sometimes queues can have a lot more than 100,000 (I've had queues with several million messages recently), and more importantly, under heavy load a postfix server can get I/O bound - which not only slows down the counting script, but also means the counting script slows down mail delivery because qmgr is being limited by how fast its rename & other disk operations can be processed. It's nice to have tracking so you can see what's going on, but it's also nice to have the tracking interfere as little as possible with postfix's productive work. For lightly loaded or lower volume servers, find -type f is fine. -- Cos