Open Rockstar04 opened 7 years ago
Want to ask about this too: are there plans to add support for incremental backups with XtraBackup?
I'd like to add this, but don't have a timeline for it. There will be some complexity in making sure holland
doesn't purge a full backup (making an incremental backup useless), and we'll need to add configuration options to define how these backups should be handle. If the framework is setup correctly, we should be able support several different incremental options.
I've been tinkering with configuration for incremental backups using the mariabackup
plugin.
Define a full
backup set with these extra options:
[mariabackup]
additional-options = --extra-lsndir=/tmp/lsn-full
[holland:backup]
create-symlinks = yes
after-backup-command = cp /tmp/lsn-full/xtrabackup_info /tmp/lsn-full/xtrabackup_checkpoints ${backupdir}/
After completion of the full
backup set, a non-compressed copy of the extrabackup_*
LSN files required for incremental backups will be available in the backup directory:
--- Starting backup run ---
Creating backup path /var/spool/holland/full/20220322_231430
Executing: /bin/mariabackup --defaults-file=/var/spool/holland/full/20220322_231430/my.cnf --backup --stream=xbstream --tmpdir=/var/spool/holland/full/20220322_231430 --slave-info --extra-lsndir=/tmp/lsn-full --target-dir=/var/spool/holland/full/20220322_231430
> /var/spool/holland/full/20220322_231430/backup.mb.gz 2 > /var/spool/holland/full/20220322_231430/mariabackup.log
Final on-disk backup size 87.92GB
Backup completed in 10 minutes, 59.99 seconds
[after-backup-command]> cp /tmp/lsn-full/xtrabackup_info /var/spool/holland/full/20220322_231430/
Now define an incremental
to perform an incremental backup based on the latest full backup:
[holland:backup]
create-symlinks = yes
after-backup-command = cp /tmp/lsn-incremental/xtrabackup_info /tmp/lsn-incremental/xtrabackup_checkpoints ${backupdir}/
[mariabackup]
additional-options = --incremental-basedir=/var/spool/holland/full/newest,--extra-lsndir=/tmp/lsn-incremental
This backup should be run once, after the full
backup:
--- Starting backup run ---
Creating backup path /var/spool/holland/incremental/20220322_234344
Executing: /bin/mariabackup --defaults-file=/var/spool/holland/incremental/20220322_234344/my.cnf --backup --stream=xbstream --tmpdir=/var/spool/holland/incremental/20220322_234344 --slave-info --incremental-basedir=/var/spool/holland/full/newest --extra-lsndir=/tmp/lsn-incremental --target-dir=/var/spool/holland/incremental/20220322_234344
> /var/spool/holland/incremental/20220322_234344/backup.mb.gz 2 > /var/spool/holland/incremental/20220322_234344/mariabackup.log
Final on-disk backup size 3.46GB
Backup completed in 2 minutes, 9.86 seconds
[after-backup-command]> cp /tmp/lsn-incremental/xtrabackup_info /tmp/lsn-incremental/xtrabackup_checkpoints /var/spool/holland/incremental/20220322_234344/
Subsequent incremental backups should be based on the latest incremental
backup.
I figure this requires a third backup set, subsequent
, with a different --incremental-basedir
option:
[mariabackup]
additional-options = --incremental-basedir=/var/spool/holland/incremental/newest,--extra-lsndir=/tmp/lsn-incremental
To enable repeated incremental backups, create a symlink in the spool
directory for incremental
as subsequent
.
Scheduling the commands:
holland bk full.conf
(infrequently)holland bk incremental
(once after the full backup)holland bk subsequent
(frequently, after incremental
has run)
Would it be possible, or within Hollands current scope to support InnoBackupex incremental backups?