1、全备和增量过程命令
mariabackup --backup --target-dir=/var/mariadb/backup/ --user=root --password= mariabackup --backup --target-dir=/var/mariadb/inc1/ --incremental-basedir=/var/mariadb/backup/ --user=root --password= mariabackup --backup --history --target-dir=/var/mariadb/inc2/ --incremental-basedir=/var/mariadb/inc1 --user=root --password= mariabackup --backup --history --target-dir=/var/mariadb/inc3/ --incremental-basedir=/var/mariadb/inc2 --user=root --password=
2、恢复过程
mariabackup --prepare --target-dir=/var/mariadb/backup mariabackup --prepare --target-dir=/var/mariadb/backup --incremental-dir=/var/mariadb/inc1 mariabackup --prepare --target-dir=/var/mariadb/backup --incremental-dir=/var/mariadb/inc2 mariabackup --prepare --target-dir=/var/mariadb/backup --incremental-dir=/var/mariadb/inc3 /etc/init.d/mysql stop mariabackup --copy-back --target-dir=/var/mariadb/backup/ /etc/init.d/mysql start
3、特别说明
MariaDB10.2.7以后不再支持使用Percona XtraBackup工具在线物理热备份,所以就自己copy一个类似工具
4、准备备份版本差异
MariaDB starting with 10.2 使用 mariabackup --prepare \ --target-dir=/var/mariadb/backup MariaDB until 10.1 使用 $ mariabackup --prepare --apply-log-only \ --target-dir=/var/mariadb/backup