How can I monitor directory size?

How can I monitor a directory size?

Q: I need to monitor a directory size (sum of file sizes in the directory). How can I do that?

A: Some examples of custom monitors are delivered with IPHost Network Monitor installation. One of them is a program that counts a directory size. This program (dirsize_kb.exe) is provided with its source code and a batch file to build the executable. To use the program, select iphost_dirsize_kb.exe from scripts folder of IPHost Monitor installation path and provide the following parameters:

directory or share name  directory to collect size for
-t timeout  timeout in seconds
-l domain:username:password  credentials to logon in case on needs to access remote server

A typical set of command-line parameters looks like:

\\SERVER\share -t 20 -l $AdminDomain:$AdminName:$AdminPassword

Note that directory size calculation can take quite a large time, so please consider running it not too frequently in order not to overload the system.

Related topics

How to check a file for presence of given string?