sum-ftp-w.sh

sum-ftp-w.sh

#! /bin/sh 
export LC_ALL=zh_CN.UTF-8 
cd /bin2/ 
sh sum-ftp-weekly.sh > sum-ftp-weekly.sh.log 2>&1

/usr/bin/mutt -s "scm1-scm4 sum-ftp-weekly" scm-svr-mtr@scm5.***.cn < sum-ftp-weekly.sh.log
 

sum-ftp-weekly.sh

#!/bin/sh 
SRCHOST="scm1-scm4" 
echo "***$SRCHOST 磁盘使用情况...***" 
du -sh /ftpdata2/ 
du -sh /ftpdata1/ 
du -sh /ftpdata3/ 
du -sh /ftpdata4/ 
echo . 
echo "***各ftp库 磁盘使用情况...***" 
SAVEIFS=$IFS 
IFS=" 
"

file1=/proftpd/proftpd1/ip.conf 
if [ -f $file1 ] 
then 
file2=`grep "ftpdata1/" $file1` 
for f in $file2 
do 
h=`echo ${f##*'Directory '}` 
i=`echo ${h%%'Output'*}` 
du -sh $i 
done 
fi

file1=/proftpd/proftpd2/ip.conf 
if [ -f $file1 ] 
then 
file2=`grep "ftpdata2/" $file1` 
for f in $file2 
do 
h=`echo ${f##*'Directory '}` 
i=`echo ${h%%'Output'*}` 
du -sh $i 
done 
fi

file1=/proftpd/proftpd3/ip.conf 
if [ -f $file1 ] 
then 
file2=`grep "ftpdata3/" $file1` 
for f in $file2 
do 
h=`echo ${f##*'Directory '}` 
i=`echo ${h%%'Output'*}` 
du -sh $i 
done 
fi

file1=/proftpd/proftpd4/ip.conf 
if [ -f $file1 ] 
then 
file2=`grep "ftpdata4/" $file1` 
for f in $file2 
do 
h=`echo ${f##*'Directory '}` 
i=`echo ${h%%'Output'*}` 
du -sh $i 
done 
fi

IFS=$SAVEIFS

你可能感兴趣的:(sum-ftp-w.sh)