MYSQL 5.6 Backup Transcript--Percona Xtrabackup

Source: Internet
Author: User
Tags chmod percona

[Email protected] ~]# CD/USR/LOCAL/SRC

[Email protected] src]# tar zxvf percona-xtrabackup-2.4.4-linux-x86_64.tar.gz-c/usr/local

[Email protected] src]# cd/usr/local

[Email protected] local]# MV Percona-xtrabackup-2.4.4-linux-x86_64/xtrabackup

[Email protected] local]# chown mysql-r xtrabackup/

[Email protected] ~]# Su-mysql

[Email protected] ~]$ Vi. bash_profile

Path= $PATH:/usr/local/xtrabackup/bin

[[email protected] ~]$ source. bash_profile


[Email protected] ~]# mkdir-p/usr/local/mysql/backup

[Email protected] ~]# chown-r mysql/usr/local/mysql/backup


[Email protected] ~]# Su-mysql

[Email protected] ~]$ VI full_backup.sh

#!/bin/bash

User= ' Root '

Passwd= ' abcd.1234 '

my_config= '/etc/my.cnf '

Backup_dir= '/usr/local/mysql/backup '

If [-f ~/.bash_profile];

Then

. ~/.bash_profile

Fi

Innobackupex--defaults-file= $my _config--user= $user--password= $passwd $backup _dir


[Email protected] ~]$ chmod a+x full_backup.sh

[Email protected] ~]$./full_backup.sh

[Email protected] ~]$ cd/usr/local/mysql/backup/

[email protected] backup]$ LL

[Email protected] backup]$ CD 2018-02-07_15-31-40/

[email protected] 2018-02-07_15-31-40]$ LL

[Email protected] ~]$ VI incr_backup.sh

#!/bin/bash

User= ' Root '

Passwd= ' abcd.1234 '

my_config= '/etc/my.cnf '

Backup_dir= '/usr/local/mysql/backup '

last_day=$ (date-d "1 days Ago" +%y-%m-%d)

filename=$ (Find $backup _dir-name "$last _day*"-print|awk-f/' {print $NF} ')

If [-f ~/.bash_profile];

Then

. ~/.bash_profile

Fi

Innobackupex--defaults-file= $my _config--user= $user--password= $passwd--incremental--incremental-basedir= $backup _dir/$filename $backup _dir


[Email protected] ~]$ chmod a+x incr_backup.sh


[Email protected] ~]$ CRONTAB-E

XX 3 * * 0/home/mysql/full_backup.sh>/usr/local/mysql/backup/full_backup.log 2>&1

XX 3 * * 1-6/home/mysql/incr_backup.sh>/usr/local/mysql/backup/incr_backup.log 2>&1


[Email protected] ~]$ crontab-l

XX 3 * * 0/home/mysql/full_backup.sh>/usr/local/mysql/backup/full_backup.log 2>&1

XX 3 * * 1-6/home/mysql/incr_backup.sh>/usr/local/mysql/backup/incr_backup.log 2>&1


MYSQL 5.6 Backup Transcript--Percona Xtrabackup

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.