Linuxphile: Shell Script to Monitor Disk Usage
Apr 27, 2006, 08:30 (1 Talkback[s])
(Other stories by Daniel McCarthy)
Desktop-as-a-Service Designed for Any Cloud ? Nutanix Frame
[ Thanks to Daniel
McCarthy for this link. ]
"Working as the TechGuy administrator I needed to create a shell
script that would monitor disk usage. Doing this required several
tweaks and learning the nuances of several shell commands. Below is
the end result of this work. The script uses a combination of awk,
egrep, cat, cut and mail commands.
"The script is written to use a temporary file, temp.txt to
store the messages when disk usage is above the limit I have set to
monitor with the variable $error..."