innobackupex-1.5.1 incremental backup error

474 views
Skip to first unread message

Muhammad Irfan

unread,
Jan 18, 2012, 5:38:58 AM1/18/12
to percona-d...@googlegroups.com
Hello,

I am able to create full backup from following command for specific db's.

$$ innobackupex-1.5.1 --user=XXXX --password=XXXX --databases="test1 test2" --defaults-file="/etc/my.cnf" --no-timestamp --stream=tar ./ | gzip -c -9 > /backup/full/fullbackup.`date +"%Y%m%d"`.tar.gz
$$ mkdir -p fullbackup.`date +"%Y%m%d"`
$$ tar -C fullbackup.`date +"%Y%m%d"` -zxif fullbackup.`date +"%Y%m%d"`.tar.gz

But for incremental backup it errors "innobackupex-1.5.1: Too many command line arguments"

$$ innobackupex-1.5.1 --user=XXXX --password=XXXX --databases="test1 test2" --defaults-file="/etc/my.cnf" --no-timestamp --incremental /backup/inc/inc1 --incremental-basedir=/backup/full/fullbackup.`date +"%Y%m%d"` --stream=tar ./ | gzip -c -9 > /backup/inc/inc1/inc1backup.`date +"%Y%m%d"`.tar.gz

If i run following command for first incremental backup. It works. but it takes backup of all databases whether i only requires diff for test1 & test2 databases.

$$ innobackupex-1.5.1 --user=backuser --password=ba$^ck123user --databases="test1 test2" --no-timestamp --incremental /backup/inc/inc1 --incremental-basedir=/backup/full/fullbackup.`date +"%Y%m%d"`


Thank you.

Alexey Kopytov

unread,
Jan 18, 2012, 9:16:38 AM1/18/12
to percona-d...@googlegroups.com
Hello Muhammad,

On 18.01.12 14:38, Muhammad Irfan wrote:

> But for incremental backup it errors "innobackupex-1.5.1: Too many command
> line arguments"
>
> $$ innobackupex-1.5.1 --user=XXXX --password=XXXX --databases="test1 test2"
> --defaults-file="/etc/my.cnf" --no-timestamp --incremental /backup/inc/inc1
> --incremental-basedir=/backup/full/fullbackup.`date +"%Y%m%d"` --stream=tar
> ./ | gzip -c -9 > /backup/inc/inc1/inc1backup.`date +"%Y%m%d"`.tar.gz
>

There are two full backup directory specifications (one after
--increment, and another one after --stream), hence the error.

But the real problem is that streaming + incremental backups are
currently not supported, because streaming is done exclusively in
innobackupex, while incremental backups must be performed by the
xtrabackup binary to scan the data files and calculate deltas. This will
be fixed in XtraBackup 2.0.

> If i run following command for first incremental backup. It works. but it
> takes backup of all databases whether i only requires diff for test1 &
> test2 databases.
>
> $$ innobackupex-1.5.1 --user=backuser --password=ba$^ck123user
> --databases="test1 test2" --no-timestamp --incremental /backup/inc/inc1
> --incremental-basedir=/backup/full/fullbackup.`date +"%Y%m%d"`
>

Yes, that's https://bugs.launchpad.net/percona-xtrabackup/+bug/569387.
The workaround is to use --databases in combination with the --include
option, e.g. --databases="test1 test2" --include="(test1|test)\..*"

Regards,
Alexey

Muhammad Irfan

unread,
Jan 18, 2012, 1:52:08 PM1/18/12
to percona-d...@googlegroups.com
Thank you for the reply.

Do i need to pass to --ibbackup flag for the xtrabackup binary than for incremental backups ?
Also is that possible that i can take full backup without streaming for specific databases.

I tried fullbackup with --databases="test1 test2" --include=test1 test2[a-z][A-Z,0-9]*
something like that but it takes all databases backup which i don't require.
when i do it through streaming it backups only mentioned databases which i want.

Can you please let me know how to take specific databases full backups ?



--
You received this message because you are subscribed to the Google Groups "Percona Discussion" group.
To post to this group, send email to percona-d...@googlegroups.com.
To unsubscribe from this group, send email to percona-discuss...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/percona-discussion?hl=en.


Alexey Kopytov

unread,
Jan 19, 2012, 2:19:14 AM1/19/12
to percona-d...@googlegroups.com
Muhammad,

On 18.01.12 22:52, Muhammad Irfan wrote:
> Thank you for the reply.
>
> Do i need to pass to --ibbackup flag for the xtrabackup binary than for
> incremental backups ?

No, you don't normally have to specify that explicitly, unless
autodetection fails for whatever reasons.

> Also is that possible that i can take full backup without streaming for
> specific databases.
>
> I tried fullbackup with --databases="test1 test2" --include=test1
> test2[a-z][A-Z,0-9]*
> something like that but it takes all databases backup which i don't require.
> when i do it through streaming it backups only mentioned databases which i
> want.
>
> Can you please let me know how to take specific databases full backups ?

The regexp in --include looks wrong to me. As I wrote, it should be
something like "(test1|test2)\..*".

Muhammad Irfan

unread,
Jan 20, 2012, 2:34:31 AM1/20/12
to percona-d...@googlegroups.com
Thanks Alex, It worked.

Final question, i want to scehdule bash script will takes full backup on sunday and incremental backups on every other day.
Now how to prepare incremental backup.

Full Backup:
innobackupex-1.5.1 --databases="test1 test2" --include="(test1|test2)\..*" --defaults-file="/etc/my.cnf" --no-timestamp /backup/full/fullbackup.`date +"%Y%m%d"`

Prepare Full Backup:
innobackupex-1.5.1 --apply-log --redo-only /backup/full/fullbackup.`date +"%Y%m%d"`

1st Incremental Backup:
innobackupex-1.5.1 --databases="test1 test2" --include="(test1|test2)\..*" --no-timestamp --incremental /backup/inc/inc1.`date +"%Y%m%d"` --incremental-basedir=/backup/full/fullbackup.`date +"%Y%m%d"`

All above worked perfectly, now i only concern it fails on preparing incremental backup.
From manual specific i did something like this. (http://www.percona.com/doc/percona-xtrabackup/innobackupex/incremental_backups_innobackupex.html)

Preparing 1st Incremental Backup:
innobackupex --apply-log /backup/full/fullbackup.`date +"%Y%m%d"` --incremental-dir=/backup/inc/inc1.`date +"%Y%m%d"`
Unknown option: incremental-dir
innobackupex-1.5.1: Bad command line arguments

OR
innobackupex --apply-log /backup/inc/inc1.`date +"%Y%m%d"`

Both fails, i am confused incremental backup should be prepared with full backup on incremetal backup or on full backup.
Should i need to copy back inc1 or fullbackup directory in case of restore.



Alexey Kopytov

unread,
Jan 20, 2012, 8:55:20 AM1/20/12
to percona-d...@googlegroups.com
Muhammad,

On 20.01.12 11:34, Muhammad Irfan wrote:
> All above worked perfectly, now i only concern it fails on preparing
> incremental backup.
> From manual specific i did something like this. (
> http://www.percona.com/doc/percona-xtrabackup/innobackupex/incremental_backups_innobackupex.html
> )
>
> Preparing 1st Incremental Backup:
> innobackupex --apply-log /backup/full/fullbackup.`date +"%Y%m%d"`
> --incremental-dir=/backup/inc/inc1.`date +"%Y%m%d"`
> Unknown option: incremental-dir
> innobackupex-1.5.1: Bad command line arguments
>

Strange, I could not repeat that error with innobackupex from XtraBackup
1.6.4.

But I spotted a bug in our documentation: the above command should
include the --redo-only option. Reported as
https://bugs.launchpad.net/percona-xtrabackup/+bug/919203

Muhammad Irfan

unread,
Jan 23, 2012, 12:48:41 AM1/23/12
to percona-d...@googlegroups.com
Ah..
Still the same error with --redo-only option.

$$ innobackupex --apply-log --redo-only /backup/full/fullbackup.`date +"%Y%m%d"` --incremental-dir=/backup/inc/inc1.`date +"%Y%m%d

> Unknown option: incremental-dir
> innobackupex-1.5.1: Bad command line arguments

When i try this.
innobackupex --apply-log --redo-only /backup/inc/inc1

It errors,
innobackupex-1.5.1: Error:
innobackupex-1.5.1: ibbackup failed at /usr/local/xtrabackup-1.5/bin/innobackupex-1.5.1 line 542.



Alexey Kopytov

unread,
Jan 23, 2012, 12:53:28 AM1/23/12
to percona-d...@googlegroups.com
Muhammad,

It looks like you are using XtraBackup 1.5 which is too old. Please try
the latest released version.

Reply all
Reply to author
Forward
0 new messages