#NAME:www.bak.to76.sh #Backup and measure Byte to some dir in /home/www/ #make in 2015-09-04 ; alter in 2015-09-05 ; #!/bin/bash echo "$(date +%Y-%m-%d-%H:%M:%S) start /root/mysh/YuanCheng.sh" >> /root/Log/www.bak.to76.log ; source=/home/www/ ; destination=root@192.168.0.76:/bak/www.bak/ ; object=mv/ ; if [ -d $source$object ] then rsync -a --delete $source$object $destination$object ; echo "$(date +%Y-%m-%d-%H:%M:%S) have been to backup to $source$object" >> /root/Log/www.bak.to76.log ; else echo "$(date +%Y-%m-%d-%H:%M:%S) ERROR:$source$object isn't have been to backed up!!" >> /root/Log/www.bak.to76.log ; fi echo "$(date +%Y-%m-%d-%H:%M:%S) start to measure Byte to $source$object" >> /root/Log/www.bak.to76.log ; du -sh $source$object >> /root/Log/www.bak.to76.log ; echo "$(date +%Y-%m-%d-%H:%M:%S) finish /root/mysh/YuanCheng.sh" >> /root/Log/www.bak.to76.log ;