sum-git-w.sh
#! /bin/sh export LC_ALL=zh_CN.UTF-8 cd /bin2/ sh sum-git-weekly.sh > sum-git-weekly.sh.log 2>&1 /usr/bin/mutt -s "scm11-scm12 sum-git-weekly" scm-svr-mtr@scm5.***.cn < sum-git-weekly.sh.log
sum-git-weekly.sh
#!/bin/sh SRCHOST="scm11-scm12" echo "***$SRCHOST 磁盘使用情况...***" du -sh /db7/ echo . echo ***各git库 磁盘使用情况...*** SAVEIFS=$IFS IFS=" " file2=`grep "<Directory" /etc/httpd/conf.d/git.conf` for f in $file2 do h=`echo ${f##*<Directory}` i=`echo ${h##*' "'}` e=`echo ${i%>*}` o=`echo ${e%'"'*}` a=`du -sh $o` b=`echo $a > /bin2/sum-git-weekly.sh.log2` c=`sed -i "//db7/$/d" /bin2/sum-git-weekly.sh.log2` cat /bin2/sum-git-weekly.sh.log2 done IFS=$SAVEIFS