MySQL database backup: Full backup + incremental backup

Source: Internet
Author: User

MySQL database backup: Full backup + incremental backup ************************************************************************************** Scheduled Tasks: crontab -e  -u root00 6  * * 1  /shell/mysqlbak.sh  &> /dev/null00 23  * * 2-7  /shell/mysqladd.sh & > /dev/null************************************************************************************** Backup database Script (mysql): Vim /shell/mysqbak.sh#!/bin/bashif [ ! -e /mysqldata ];thenmkdir  /mysaldatafiday= ' date +%f ' mysqldump -u root -p123456 mysql > / Mysqldata/mysql. $Day. sql# chmod +x /shell/mysqbak.sh******************************************* Backup Database log script (all journal files): Vim /shell/mysqllogall.sh#!/bin/bash#/logdir   Start Binlog log, name the log file with your own name &nbsp, log file    save to/logdir directory #/baklogdir  plan binlog log backup directory if [  ! -e /baklogdir ];thenmkdir /baklogdirfifor log in  ' cat /logdir/glk.index ' dologname= ' echo   $log  | awk -F  "/"   ' {print $3} '     cp -rf   /logdir/$logname  /baklogdir/donechmod +x /shell/mysqllogall.sh*************************** Backup Database log script (new Journal file): vim /shell/mysqllogadd.sh#!/ bin/bash#/logdir  start the Binlog log, use your name to log files, save to/logdir directory #/baklogdir  plan binlog log backup directory if [ !  -e /baklogdir ];thenmkdir /baklogdirfifor log in  ' cat /logdir/ Glk.index ' dologname= ' echo  $log  | awk -F  "/"   ' {print $3} '      if [ ! -e /baklogdir/$logname   ];THEN    CP -RF   /logdir/$logname  /baklogdir/    fidonemysql -uroot -p123456  -e  "Flush logs" &Nbsp;&> /dev/nullchmod +x /shell/mysqllogadd.sh******************************************     today, beginner MySQL database backup, here to remember. 2016-05-27 21:50


This article is from "thorough learning or thorough execution!" "Blog, be sure to keep this provenance http://guolikai.blog.51cto.com/11566459/1783929

MySQL database backup: Full backup + incremental backup

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.