0

It says on the manual that if you want to create an incremental backup you can do it with the following command:

xtrabackup --backup --target-dir=/data/backups/inc1 \
--incremental-basedir=/data/backups/base --datadir=/var/lib/mysql/

where /data/backups/inc1 is the incremental directory. So now if I want to create a cronjob (which I don't think I'm the only one), I have to figure out a way to name my directory every time I want to create a new incremental backup, which could be tedious.

Is there any way to maje xtrabackup to create directories using timestamps instead?

VaTo
  • 2,936
  • 7
  • 38
  • 77
  • Use innobackupex instead of xtrabackup. The former is a wrapper and adds things like auto-timestamps to directories. – utdrmac Jun 28 '16 at 20:36

1 Answers1

1

you can use built-in Linux command date to name directory as you want, for example

xtrabackup --backup --target-dir=/data/backups/inc`date +%Y%m%d` (rest options)