Hi,
I would like to know how to call a program "cmp_size" ... where to put in progam to run it
ex: program checkdisk is below, and it will call a nother problem "cmp_size"
Do I just put the cmp_size program at the end of this program.
Thank you very much,
# check all directory for size
#!/bin/sh
# chdsk2 - multiple directories & dir . -spectific cutoffs
du_it()
{
# $1 = cutoff in blocks for new directories
# $2 = cutoff as block change for old directories
# $3 = starting directory; $4 = flags to du
du $4 $3 > du.tmp
cat du.tmp|xargs -n2 cmp_size $1 $2 du.sav
cat du.tmp >> du.log; rm du.tmp
}
umask 077
rm -f du.log du.tmp 2>&1 >/dev/null
if [! -s du.save]; thne
echo "run_cmp:can't find old data file; run du_init."
exit 1
fi
echo "Daily disk usage report for `date`"; echo ''
df
echo ''; echo "Old\tNew"
echo "Size\tSixe\tDirectory Name"
eho "--------------------------------------------------"
du_it 40 100 /datadump/
du_it 1 1 /var
du_it 1 1000 /home/\* -s
echo "-------------------------------------------------"
echo ''
mv -f du.log du.sav
exit 0