$Header: /home/cvs/dobackup/README.restore,v 1.5 2004/01/09 23:14:32 imorgan Exp $ Restore Mini HOW-TO for Dobackup -------------------------------- This is a quick how-to indicating one way to restore a file pattern from the afio backup files that Dobackup creates by default. It isn't particularily pretty, but it works, and it's what we use. Until there's a "Dorestore" command, there's not much else. This process assumes you are using "Disk" or "Filesystem" mode for your backups. If you use "Tape" mode, you will have to read the afio(1) and mt(1) man pages for more details on reading backup files from tape. You really ought to read the man page for afio and be familiar with it. It has a lot of options that aren't covered here, and could save your butt if you critically need a file restored and don't have these docs around. Process: -------- 1) Login to the server on which you want to do the restore, as a user who has access to the backups (ex. root), then do something like this: # cd /tmp # mkdir restore_20011211 # cd restore_20011211 2) Get a listing of the backup files (this is just an example): # ls -s /mnt/backups 0 MEDIAUNIT=WD64 519440 host_20011201_011500.full 4796 host_20011202_014348.incr 9020 host_20011203_011500.incr 27840 host_20011204_011500.incr 1348 host_20011205_011500.incr 4788 host_20011206_011501.incr 14972 host_20011207_011500.incr 48340 host_20011208_011501.incr 25356 host_20011209_011500.incr 11092 host_20011210_011500.incr If you don't see something like the output above you may need to: # mount /mnt/backups. 3) "Normal" Incremental backup mode: To fully restore a set of files matching a desired pattern, you need to restore those files from the most recent full backup and all subsequent incremental backups up to the date of the files you want restored. In the above example, the last full backup is easily destinguished by A) it's large size, and B) it's date (in this case, the backup policy demands a full backup on the first day of each month). You should be familiar with your implemented backup policy to be able to quickly find the relevant backup files. Note: As of version 4.21, all "full" backup files are tagged with ".full" on the end of the archive name, and "normal" incremental files have ".incr" appended. "Timewarp" backup mode: In this mode, only two archives are required: The most recent full backup (".full"), and the most recent timewarp mode file (".warp") for the timeframe to which you want to restore. For example, these files might be selected: host_20011201_011500.full, and host_20011210_011500.warp 4) (Optional) diffdel.pl: During a restore, you may only want to only see non-redundant files i.e. ones which don't already exist in another filesystem. Another one of our tools called diffdel.pl can save you a lot of time by removing files from one filesystem for which an identical version exists in a second. For example, suppose you want a /tmp/restore/home which only contains files which don't match what is already in /home. So you restore /home to /tmp/restore/home and then do: cd /tmp/restore; diffdel.pl home /home Example: -------- Here is an example that restores everything under /etc: 1) First, restore the most recent full backup. # afio -i -v -Z -y etc/\* /mnt/backup/host_20011201_011500.full 2) Then restore each of the subsequent incremental backups, in order, or just the most recent timewarp backup: # "Normal" mode # afio -i -v -Z -y etc/\* /mnt/backup/host_20011202_014348.incr # afio -i -v -Z -y etc/\* /mnt/backup/host_20011203_011500.incr # afio -i -v -Z -y etc/\* /mnt/backup/host_20011204_011500.incr # afio -i -v -Z -y etc/\* /mnt/backup/host_20011205_011500.incr # afio -i -v -Z -y etc/\* /mnt/backup/host_20011206_011501.incr # afio -i -v -Z -y etc/\* /mnt/backup/host_20011207_011500.incr # afio -i -v -Z -y etc/\* /mnt/backup/host_20011208_011501.incr # afio -i -v -Z -y etc/\* /mnt/backup/host_20011209_011500.incr # afio -i -v -Z -y etc/\* /mnt/backup/host_20011210_011500.incr # "Timewarp" mode # afio -i -v -Z -y etc/\* /mnt/backup/host_20011210_011500.warp NOTE: The pattern (after -y) should NOT begin with a leading "/". Afio strips the leading "/" during backup. Recent versions of afio will ignore a leading "/" in your specified pattern, but earlier versions would NOT match if you included it. Just to be sure, leave it out. 3) The results of your restore will now be in /tmp/restore_20011211. Just copy the files to their original locations and you're done. 4) We have another useful tool here: http://www.webcon.ca/opensource/diffdel/ It is a Perl script for removal of redundant files from a filesystem that exist in another filesystem. cd /tmp/restore_20011211; diffdel.pl etc /etc This will help you to clean out unchanged files from the restored copy, so that you can concentrate on merging back in just the things that have changed.