[ 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…”