检查目录下备份文件的脚本

#!/bin/bash

bak_dir='/data/dbbak/'
for i in `ls $bak_dir`
do
    bak=`find ${bak_dir}${i}/ -mtime -1 -name "*.gz"`
    for n in $bak
    do
        size=`du -sh $n |awk -F' ' '{print $1}'`
        printf "%-30s%-70s\t%-10s\n" "$i的备份:" $n $size
    done
done

 

posted @ 2017-02-07 09:53  行知散人  阅读(175)  评论(0编辑  收藏  举报