检查目录下备份文件的脚本
#!/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
#!/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