PDA

View Full Version : Easy way to restore all incremental backups since last full backup?



robinbowes
September 19th, 2008, 04:27 AM
Hi,

I wonder, is there an easy way to restore all the incremental backups since the last full backup?

At the moment, I'm using mysql-zrm-reporter --show restore-info to get a list of available backups:

REPORT TYPE : restore-info

backup_set backup_date backup_level backup_directory backup_status comment
-----------------------------------------------------------------------------------------------------------------------------------------------------
app01 Fri 19 Sep 2008 10:34:01 1 /var/lib/mysql-zrm/app01/20080919103401 Backup succeeded ----
AM PDT
app01 Fri 19 Sep 2008 09:34:01 1 /var/lib/mysql-zrm/app01/20080919093401 Backup succeeded ----
AM PDT
app01 Fri 19 Sep 2008 08:34:01 1 /var/lib/mysql-zrm/app01/20080919083401 Backup succeeded ----
AM PDT
app01 Fri 19 Sep 2008 07:34:01 1 /var/lib/mysql-zrm/app01/20080919073401 Backup succeeded ----
AM PDT
app01 Fri 19 Sep 2008 06:34:01 1 /var/lib/mysql-zrm/app01/20080919063401 Backup succeeded ----
AM PDT
app01 Fri 19 Sep 2008 05:34:01 1 /var/lib/mysql-zrm/app01/20080919053401 Backup succeeded ----
AM PDT
app01 Fri 19 Sep 2008 04:34:01 1 /var/lib/mysql-zrm/app01/20080919043401 Backup succeeded ----
AM PDT
app01 Fri 19 Sep 2008 03:34:01 1 /var/lib/mysql-zrm/app01/20080919033401 Backup succeeded ----
AM PDT
app01 Fri 19 Sep 2008 02:34:02 1 /var/lib/mysql-zrm/app01/20080919023402 Backup succeeded ----
AM PDT
app01 Fri 19 Sep 2008 01:34:01 1 /var/lib/mysql-zrm/app01/20080919013401 Backup succeeded ----
AM PDT
app01 Fri 19 Sep 2008 12:34:01 1 /var/lib/mysql-zrm/app01/20080919003401 Backup succeeded ----
AM PDT
app01 Fri 19 Sep 2008 12:10:04 1 /var/lib/mysql-zrm/app01/20080919001004 Backup succeeded ----
AM PDT
app01 Fri 19 Sep 2008 12:09:04 0 /var/lib/mysql-zrm/app01/20080919000904 Backup succeeded ----
AM PDT


Then, selecting the last full backup and restoring it:

mysql-zrm-restore --source-directory /var/lib/mysql-zrm/app01/20080919000904

Then, creating a blog to select all incremental backups since the last full and restore each one:

for d in /var/lib/mysql-zrm/app01/20080919{00{10,34},01,02,03,04,05,06,07,08,09,10}* ; do mysql-zrm-restore --source-dir $d; done

It would be nice to be able to do something like:

mysql-zrm-restore --backup-set app01 --since /var/lib/mysql-zrm/app01/20080919000904

Or, better still:

mysql-zrm-restore --backup-set app01 --since last-full

R.

paddy
September 29th, 2008, 03:05 PM
We don't have solution in community edition. I guess you can write a wrapper script to accomplish this task.

ZRM enterprise edition web based UI provides this capability.

Paddy