#!/bin/bash
file =$(date +%y%m%d%H%M)
logfile=/home/目录名/backup/file.log
echo "------"$(date +%Y-%m-%d%t%A%t%T)" Beginning backup--------" >>${logfile}
#tar..
tar -zcvf /home/ftp/1520/项目名称-20130801-OAl/$(date +%y%m%d%H%M)项目名称.tar.gz /home/ftp/1520/项目名称-20130801-OAl/www.项目名称.cn >>${logfile}
echo "------"$(date +%Y-%m-%d%t%A%t%T)" Ending backup------" >>${logfile}
#....
tail -50 ${logfile} | mutt -s "项目名称...." -a /home/ftp/1520/项目名称-20130801-OAl/$(date +%y%m%d%H%M).tar.gz 496317580@qq.com
#........
另存为 xxx.sh