Xtrabackup One-click Automated Backup Script "original"

Source: Internet
Author: User

Xtrabackup One-click Automated backup Script V1 "original"


Xtrabackup Backup tool installation and use

http://990487026.blog.51cto.com/10133282/1697094


Information to fill in

Backup file path Backdir=/asset.innobackupexmysql used to back up the user User=rootmysql user's password pass=asset output information save path logfile=/var/www/htm L/index.html

L

[[Email protected] ~]# vim innobackupex.v1.sh[[email protected] ~]# cat  innobackupex.v1.sh#!/bin/bashbackdir=/ASSET.innobackupexmkdir  $backdirweek = ' date +%u ' last= ' ls   $backdir   | tail -n 1 ' User=rootpass=assetlogfile=/var/www/html/index.htmlif  [ ! -f  /globalback ]then    cat /dev/null >   $logfile     innobackupex --user= $user  -password= $pass   $backdir      ls  $backdir  | tail -n 1 > /globalback     basedir= ' Cat /globalback '     echo  <br>  detected no global backup before Full backup once! <br>  >>  $logfile     echo  location of data backup    $backdir/$basedir  <br>   >>  $logfile     echo -n  The log file used for this global backup, Cutoff location information: "  >>  $logfile     cat  $backdir/$basedir/xtrabackup_binlog_info  >>   $logfile     echo -n  "<br>  binary log file path"   >> $ logfile    grep  "^log-bin"  /etc/my.cnf  >>  $logfileexitfiif  [  $week  -eq 5 ]then    innobackupex --user= $user  - password= $pass   $backdir     ls  $backdir  | tail -n 1 >  /globalback    basedir= ' Cat /globalback '     echo  < Br><br> today is week 5, global backup <br>   >>  $logfile     echo  Location of data backup    $backdir/$basedir  <br>   >>  $logfile      echo -n  "Log files used by this global backup, cutoff location information:"   >>  $logfile     cat   $backdir/$basedir/xtrabackup_binlog_info  >>  $logfile     echo -n  "<br>   Binary log file path "  >>  $logfile     grep " ^log-bin " /etc/ my.cnf  >>  $logfileelse    basedir= ' Cat /globalback '     innobackupex --user= $user  -password= $pass  --incremental  $backdir  -- incremental-basedir= $backdir/$basedir     incre= ' ls  $backdir  | tail -n  1 '     echo  <br><br> today is the week $week, incremental backup  <br> '    >>  $logfile     echo  "Base    this library is   $backdir $BASEDIR&NBSP;&LT;BR >   >>  $logfile     echo  Last Backup is   $backdir $last <br >   >>  $logfile     echo  This backup is   $backdir $incre < Br> "  >>  $logfile     echo -n  "log file used by the last global backup, cutoff location information:"   >>  $logfile      cat  $backdir/$basedir/xtrabackup_binlog_info  >>  $logfile      echo -n  "<br>  log files used by this incremental backup, cutoff location information:"   >>  $logfile      cat  $backdir/$incre/xtrabackup_binlog_info  >>  $logfile      echo -n  <br> binary log file path   >>  $logfile      grep  "^log-bin"  /etc/my.cnf  >>  $logfilefi end of script



=============================================

Browser Access Effect HTTP://10.11.12.2/


No global backup has been detected before, full backup once!

Location of data backup/asset.innobackupex/2015-09-26_00-03-08

Log file used by this global backup, cutoff location information: master-bin.0000021845

Binary log file path Log-bin=/mydata/binlogs/master-bin


Today is the week 6, incremental backup

Basic Library is/asset.innobackupex2015-09-26_00-03-08

Last Backup is/asset.innobackupex2015-09-26_00-03-08

This backup is/asset.innobackupex2015-09-26_00-03-25

Log file used by the last global backup, cutoff location information:master-bin.000002 1845

Log files used by this incremental backup, cutoff location information: master-bin.0000021845

Binary log file path Log-bin=/mydata/binlogs/master-bin


Today is the week 6, incremental backup

Basic Library is/asset.innobackupex2015-09-26_00-03-08

Last Backup is/asset.innobackupex2015-09-26_00-03-25

This backup is/asset.innobackupex2015-09-26_00-06-29

Log file used by the last global backup, cutoff location information:master-bin.000002 1845

Log files used by this incremental backup, cutoff location information: master-bin.0000021845

Binary log file path Log-bin=/mydata/binlogs/master-bin


Today is the week 6, incremental backup

Basic Library is/asset.innobackupex2015-09-26_00-03-08

Last Backup is/asset.innobackupex2015-09-26_00-06-29

This backup is/asset.innobackupex2015-09-26_00-23-27

Log file used by the last global backup, cutoff location information:master-bin.000002 1845

Log files used by this incremental backup, cutoff location information: master-bin.0000021845

Binary log file path Log-bin=/mydata/binlogs/master-bin


Today is week 5, global backup

Location of data backup/asset.innobackupex/2015-10-02_00-00-05

Log file used by this global backup, cutoff location information: master-bin.0000021845

Binary log file path Log-bin=/mydata/binlogs/master-bin


This article comes from "Life is endless, tossing and turning." "blog, declined reprint!"

Xtrabackup One-click Automated Backup Script "original"

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.