- #!/bin/bash
- date=`date +%Y%m%d`
- mysqlFile=/opt/shell/mysql/${date}.sql
- ip=`/sbin/ifconfig eth1|grep inet|grep -v 127.0.0.1|grep -v inet6|awk '{print $2}'|tr -d "addr:"`
- #数据库全量备份
- /usr/local/mysql/bin/mysqldump -h127.0.0.1 -uroot -pzt20152008 huahuibao -l > ${mysqlFile}
- /usr/bin/rsync -avze ssh ${mysqlFile} root@118.190.3.200:/opt/target_backup/${ip}/mysql
- /bin/rm -rf ${mysqlFile}
- /usr/local/nginx/html/huahuibao/yii shell/week-notice ${ip}
|