Percona Xtrabackup MySQL 全备
- - CSDN博客数据库推荐文章作者:ylqmf 发表于2013-3-24 17:29:55 原文链接. 阅读:99 评论:0 查看评论.
#!/bin/sh BACKUP_TIME=`date +%Y-%m-%d-%H-%M-%S` BACKUP_SOCK=/tmp/mysql3306.sock BACKUP_CNF=/etc/my3306.cnf BACKUP_USER=user BACKUP_PWD=123456 BACKUP_DB=employees BACKUP_DIR=/data/backup/mysql/backup3306/ BAK=${BACKUP_DIR}${BACKUP_DB}_${BACKUP_TIME} INNOBACKUPEX=/opt/soft/xtrabackup-1.6.6/innobackupex ${INNOBACKUPEX} --defaults-file=${BACKUP_CNF} --socket=${BACKUP_SOCK} --user=${BACKUP_USER} --password=${BACKUP_PWD} ${BAK} --no-timestamp #${INNOBACKUPEX} --defaults-file=${BACKUP_CNF} --socket=${BACKUP_SOCK} --user=${BACKUP_USER} --password=${BACKUP_PWD} ${BAK} --no-timestamp --stream=tar > ${BAK}.tar #${INNOBACKUPEX} --defaults-file=${BACKUP_CNF} --apply-log --use-memory=4G ${BAK} cd ${BACKUP_DIR} tar zcf ${BACKUP_DB}_${BACKUP_TIME}.tar.gz ${BACKUP_DB}_${BACKUP_TIME} rm -rf ${BACKUP_DB}_${BACKUP_TIME}