From Wiki-UX.info

Wiki-UX / Backup Commands / How to use frecover from remote host
Jump to: navigation, search

How to use frecover from remote host

Abstract

This article shows an example of how to use the frecover command to extract files to a remote tape drive across the network.

The test directory /var/tmp is used to create a fbackup archive of its content. Selective recovery extraction is done later.

Contents


Create a test directory structure

# ll /var/tmp
 
# cd /var/tmp
for dir in a b c d e
do
   mkdir /var/tmp/dir${dir}
   cd /var/tmp/dir${dir}
 
   for file in 1 2 3 4 5
   do
      dd if=/dev/zero of=test${file} bs=1024k count=2
   done
done
 
# ll -d /var/tmp/*
drwx------   2 root       sys             96 Aug  8 10:58 /var/tmp/dira
drwx------   2 root       sys             96 Aug  8 10:58 /var/tmp/dirb
drwx------   2 root       sys             96 Aug  8 10:58 /var/tmp/dirc
drwx------   2 root       sys             96 Aug  8 10:58 /var/tmp/dird
drwx------   2 root       sys             96 Aug  8 10:58 /var/tmp/dire

Direct backup using fbackup command

# mt -f /dev/rmt/0m status
Drive:  HP C7438A
Format:
Status: [41112600] BOT online compression immediate-report-mode
File:   0
Block:  0
 
# fbackup -0vi /var/tmp -f /dev/rmt/0m
fbackup(1004): session begins on Fri Aug  8 10:59:33 2008
fbackup(3203): volume 1 has been used 1 time(s)
fbackup(3024): writing volume 1 to the output file /dev/rmt/0m
    1: / 16
    2: /var 16
    3: /var/tmp 16
    4: /var/tmp/dira 1
    5: /var/tmp/dira/test1 4096
    6: /var/tmp/dira/test2 4096
    7: /var/tmp/dira/test3 4096
    8: /var/tmp/dira/test4 4096
    9: /var/tmp/dira/test5 4096
   10: /var/tmp/dirb 1
   11: /var/tmp/dirb/test1 4096
   12: /var/tmp/dirb/test2 4096
   13: /var/tmp/dirb/test3 4096
   14: /var/tmp/dirb/test4 4096
   15: /var/tmp/dirb/test5 4096
   16: /var/tmp/dirc 1
   17: /var/tmp/dirc/test1 4096
   18: /var/tmp/dirc/test2 4096
   19: /var/tmp/dirc/test3 4096
   20: /var/tmp/dirc/test4 4096
   21: /var/tmp/dirc/test5 4096
   22: /var/tmp/dird 1
   23: /var/tmp/dird/test1 4096
   24: /var/tmp/dird/test2 4096
   25: /var/tmp/dird/test3 4096
   26: /var/tmp/dird/test4 4096
   27: /var/tmp/dird/test5 4096
   28: /var/tmp/dire 1
   29: /var/tmp/dire/test1 4096
   30: /var/tmp/dire/test2 4096
   31: /var/tmp/dire/test3 4096
   32: /var/tmp/dire/test4 4096
   33: /var/tmp/dire/test5 4096
fbackup(1005): run time: 18 seconds
fbackup(3055): total file blocks read for backup: 102453
fbackup(3056): total blocks written to output file /dev/rmt/0m: 102615

Basic remote extraction

# rm -rf /var/tmp/*
 
# frecover -vr -f delta:/dev/rmt/0m
drwx------      root    sys     /var/tmp/dira
-rw-------      root    sys     /var/tmp/dira/test1
-rw-------      root    sys     /var/tmp/dira/test2
-rw-------      root    sys     /var/tmp/dira/test3
-rw-------      root    sys     /var/tmp/dira/test4
-rw-------      root    sys     /var/tmp/dira/test5
drwx------      root    sys     /var/tmp/dirb
-rw-------      root    sys     /var/tmp/dirb/test1
-rw-------      root    sys     /var/tmp/dirb/test2
-rw-------      root    sys     /var/tmp/dirb/test3
-rw-------      root    sys     /var/tmp/dirb/test4
-rw-------      root    sys     /var/tmp/dirb/test5
drwx------      root    sys     /var/tmp/dirc
-rw-------      root    sys     /var/tmp/dirc/test1
-rw-------      root    sys     /var/tmp/dirc/test2
-rw-------      root    sys     /var/tmp/dirc/test3
-rw-------      root    sys     /var/tmp/dirc/test4
-rw-------      root    sys     /var/tmp/dirc/test5
drwx------      root    sys     /var/tmp/dird
-rw-------      root    sys     /var/tmp/dird/test1
-rw-------      root    sys     /var/tmp/dird/test2
-rw-------      root    sys     /var/tmp/dird/test3
-rw-------      root    sys     /var/tmp/dird/test4
-rw-------      root    sys     /var/tmp/dird/test5
drwx------      root    sys     /var/tmp/dire
-rw-------      root    sys     /var/tmp/dire/test1
-rw-------      root    sys     /var/tmp/dire/test2
-rw-------      root    sys     /var/tmp/dire/test3
-rw-------      root    sys     /var/tmp/dire/test4
-rw-------      root    sys     /var/tmp/dire/test5

Selective remote extraction

Create a graph file, for example /tmp/frecover.graph with a list of the directories to be included or excluded from the recovery session.

Example:

cat >> /tmp/frecover.graph << EOF
i /var/tmp/dira
i /var/tmp/dirc
i /var/tmp/dire
e /var/tmp/dirb
e /var/tmp/dird
EOF

Recover the directories using the fbackup command x and g options.

# frecover -vx -f <hostname>:/dev/rmt/0m -g /tmp/frecover.grap

For example:

# frecover -vx -f hostname:/dev/rmt/0m -g /tmp/frecover.graph
drwx------      root    sys     /var/tmp/dira
-rw-------      root    sys     /var/tmp/dira/test1
-rw-------      root    sys     /var/tmp/dira/test2
-rw-------      root    sys     /var/tmp/dira/test3
-rw-------      root    sys     /var/tmp/dira/test4
-rw-------      root    sys     /var/tmp/dira/test5
drwx------      root    sys     /var/tmp/dirc
-rw-------      root    sys     /var/tmp/dirc/test1
-rw-------      root    sys     /var/tmp/dirc/test2
-rw-------      root    sys     /var/tmp/dirc/test3
-rw-------      root    sys     /var/tmp/dirc/test4
-rw-------      root    sys     /var/tmp/dirc/test5
drwx------      root    sys     /var/tmp/dire
-rw-------      root    sys     /var/tmp/dire/test1
-rw-------      root    sys     /var/tmp/dire/test2
-rw-------      root    sys     /var/tmp/dire/test3
-rw-------      root    sys     /var/tmp/dire/test4
-rw-------      root    sys     /var/tmp/dire/test5

Reference

Authors

Editor

This page was last modified on 18 April 2011, at 22:50. This page has been accessed 2,078 times.