|

楼主 |
发表于 2007-7-12 11:13:03
|
显示全部楼层
(3)高人们帮我具体解释一下,谢谢你们
#!/bin/bash
date=`date +%F`
log=/bak/log/increment/$date.txt
if [ -f $log ]
then rm -fr $log
fi
echo -e "\n"
echo -e "\n"
echo "This is increment_backuped, begining at `date +%c`" >$log
echo "------------------------------------------------------------------">>$log
/usr/local/bin/rsync -av --delete --backup --backup-dir=/bak/increment/$date /data/d /sdb3 >>$log
/usr/local/bin/rsync -Ar /data/d /sdb3
echo "------------------------------------------------------------------">>$log
echo -e "Increment_backuped file size: \a">>$log
du -h /bak/increment/$date|tail -1 |sed 's/\/.*//g'>>$log
echo -e "Increment_backuped file count: \a">>$log
find /bak/increment/$date -type f |wc -l >>$log
echo -e "Increment_backuped directory count: \a">>$log
find /bak/increment/$date -type d |wc -l >>$log
echo "This is increment_backuped, Ended at `date +%c`" >>$log |
|