Coder Social home page Coder Social logo

mysql-backup-scripts's Introduction

mysql-backup-scripts

物理备份和逻辑备份脚本

  • xtrabackup文件夹为物理备份
    • 物理备份可配置备份到本地或远端服务器(不落地备份),采用流备份,科并行效率高
    • 流备份解压,需安装qpress,安装包在文件夹里,解压即可(tar xvf qpress-11-linux-x64.tar && cp qpress /usr/bin)
    xbstream -x < xxxxxx.xbstream -C ./restore 
    cd restore
    for f in `find ./ -iname "*\.qp"`; do qpress -dT2 $f  $(dirname $f) && rm -f $f; done
  • mydumper文件夹为逻辑备份
    • 逻辑备份可配置备份到本地或远端服务器,备份远端为先备份到本地,再通过rsync传至远端服务器
  • delete_obsolete_backup文件夹为删除指定保留日期文件删除脚本

使用方法:

  • 物理备份
    • 安装xtrabackup
    • 修改配置文件
    • 添加crontab(0 0 * * * /xtrabackup.sh -f xtraBackup_full_3306.cnf &> /tmp/xtrabackup_3306.log)
    • 配置微信企业号,可微信通知
  • 逻辑备份
    • 安装mydumper
    • 修改配置文件
    • 添加crontab(0 0 * * * /mydumper.sh -f -f mydumper_3306.cnf &> /tmp/mydumper_3306.log)
    • 配置微信企业号,可微信通知

mysql-backup-scripts's People

Contributors

guyage avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.