|
From: | lconrad |
Subject: | Re: Directory Size |
Date: | Thu, 05 Mar 2015 12:00:06 -0600 |
here's script I use to convert the number of msgs in postfix queues to bytes in a file (freebsd syntax) #!/bin/sh for Q in incoming active deferred hold ; do SIZE="`find /var/spool/postfix/$Q -maxdepth 5 -type f | wc -l | tr -d ' ' `" dd if=/dev/zero bs=1 count=$SIZE of=/var/db/postfix/q_size_$Q done exit 0 then I have monit check the file size of the files q_size_* to alert when a queue gets too large for too long =========== for tree depth = 0 : du -d0 /path/to/dir | cut -f1 > /var/db/monit/dirname ... has the file dirname with the number of bytes in the tree at and below /path/to/dir so you monit that filesize in bytes for the tree size Len On Thursday 05/03/2015 at 11:48 am, Kevin Chadwick wrote: On Thu, 5 Mar 2015 17:05:01 +0100 |
[Prev in Thread] | Current Thread | [Next in Thread] |