We are scripting a mix of full and incremental backup setup for our prodcut backend with sunday triggering full backup and incremental backup on all the remaining days.
In this process, we should be able to read the LSN number of a file from the full backup file.
We have setup the script to compress the backup into xbstream format so it would result one single file compressing all the data.
Now the question is how to extract or read the LSN or one single info file from the complete xbstream file.
Though we can use log file for this, we wanted a more dependable solution.
Thank you.
Best Answer
XtraBackup logs the most recent LSN not only in
xtrabackup_info
which you'll have to extract, but to STDERR, too:The LSN would be
1948062848
. Find stringxtrabackup: The latest check point (for incremental):
in the output. See http://bazaar.launchpad.net/~twindb-dev/twindb-agent/trunk/view/head:/twindb.py#L1888 for example:Then, pass
1948062848
with--incremental-lsn=
option when you take an incremental copy. Example: http://bazaar.launchpad.net/~twindb-dev/twindb-agent/trunk/view/head:/twindb.py#L1429