简体   繁体   中英

how can I create incremental backups with xtrabackup automatically

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?

您可以使用内置的Linux命令date根据需要命名目录,例如

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM