Snalk

Snalk » OS Tutorials » Unix » Restoring Data from rdiff-backup

Reply
  #1 (permalink)  
Old 10-31-2008, 11:13 AM
Member
 
Join Date: Oct 2008
Posts: 46
Post Restoring Data from rdiff-backup

Restoring Data from rdiff-backup



Once you have a backup directory, you can quickly display a listing of the increments available. An increment is some previous date for which exact files are available. Whenever you run rdiff-backup, the current mirror is updated and a new increment is created, still allowing you to retrieve the previous set of data. Here is an example listing of increments:

% rdiff-backup -l /some/backup/directory
Found 4 increments:
increments.2003-01-02T23:30:45-04:00.dir Thu Jan 2 23:30:45 2003
increments.2003-01-03T23:31:40-04:00.dir Fri Jan 3 23:31:40 2003
increments.2003-01-04T23:31:54-04:00.dir Sat Jan 4 23:31:54 2003
increments.2003-01-05T23:32:02-04:00.dir Sun Jan 5 23:32:02 2003
Current mirror: Mon Jan 6 23:32:18 2003


There are two ways to restore data from an rdiff-backup archive. One is to look through the data and run rdiff-backup on one of the increment files. The second method is to use the –restore-as-of(-r) switch.

Let's assume that the backup archive shown in the previous increment listing was created by the following backup script, executed at around 23:30 every day:

rdiff-backup /etc /some/backup/directory

Now, assuming it is Tuesday at 16:00, and I want to restore the /etc/ directory as it was yesterday at this time, I would run the following command:

rdiff-backup -r 1D /some/backup/directory /tmp/etc.old

Since no backup was performed exactly one day ago, the next oldest increment is used. In this case, that would be the backup performed on Sunday night (2003-01-05T23:32:02-04:00). I could also have specified this full date string instead of 1D as the argument to the -r switch.

The exact state of the /etc/ directory when that backup was performed is now re-created in the local directory /tmp/etc.old/. You can then do anything you would like within this temporary directory.
Reply With Quote
Reply

Bookmarks

Tags
backup, rdiff-backup, restoring data, unix

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump



All times are GMT. The time now is 09:16 PM.
Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.