0

So I'm implementing a backup strategy for our project and came across some text which I need absolute clarification, false positives are the death nell of IT.

I am looking to do your typical backup strategy, weekly full back-up with daily incremental backups. Here's the rub:

According to the docs, when doing a full backup you have to 'prep' it, which is to run all uncommitted transactions etc. You can prep the backup by using the innobackupex --apply-log /path/to/BACKUP-DIR command.

But according to these docs, if you do an incremental backup, you have to 'prep' it differently, using the innobackupex --apply-log --redo-only BASE-DIR command.

My plan is to write a cronjob to do a full backup on Sunday @ 12:01am, and an incremental on M-Sa @ 12:01 am. So my question is, should the cronjob prep every backup with the --redo-only flag, to ensure that full backup can be merged with following incremental backups?

  • 1
    i'll recommend a friend's work, try to check pyxbackup it is an xtrabackup 'wrapper' – jerichorivera Jul 22 '16 at 11:09
  • 1
    The question is about how to prepare the backups... not the binary – Mike Purcell Jul 23 '16 at 1:54
3

No, you don't need to prep every backup. You only need to create the full backup on Sunday and then create the incrementals from Monday to Saturday.

Full:

innobackupex --user=USER --password=PASSWORD /path/to/backup/dir/

Incr:

innobackupex --incremental /path/to/inc/mon --incremental-basedir=$FULLBACKUP --user=USER --password=PASSWORD

innobackupex --incremental /path/to/inc/tue --incremental-basedir=/path/to/inc/mon --user=USER --password=PASSWORD

The prepare phase (--apply-log) is only needed when you restore the backup.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.