Hi there --
I am writing a script, based on one from an older UNIX reference guide, that is meant to check the size of a series of folders, and if any exceed a defined size, the administrator will be notified via e-mail.
The syntax of the script is currently the following:
Code:
#!/bin/bash
# check folder size
clinics='ls -1 /CMS/xiodata'
limit=80000
for clinic in $clinics
do
diskuse='du -hcs /CMS/$clinics | awk '{print $1 }' -`
if [ $diskuse -gt $limit ]
then
/bin/mailx -s Clinic Folder Size admin@company.com <<!
System Administrator --
The folder size of the $clinic is over the $limit. Investigate the matter
further to determine what steps need to be done to correct this issue.
!
fi
done
I had some questions that hopefully I could get feedback:
1. The limit= line sets the amount 80000 blocks. What would the syntax be to set the amount to 400 gigabytes.
2. Should the clinics= line read as-is, or should the syntax be the following:
Code:
clinics='ls -lh /CMS/xiodata'
Thanks.