Imported Upstream version 2.4.5
[debian/amanda] / man / amrestore.8
1 .\"Generated by db2man.xsl. Don't modify this, modify the source.
2 .de Sh \" Subsection
3 .br
4 .if t .Sp
5 .ne 5
6 .PP
7 \fB\\$1\fR
8 .PP
9 ..
10 .de Sp \" Vertical space (when we can't use .PP)
11 .if t .sp .5v
12 .if n .sp
13 ..
14 .de Ip \" List item
15 .br
16 .ie \\n(.$>=3 .ne \\$3
17 .el .ne 3
18 .IP "\\$1" \\$2
19 ..
20 .TH "AMRESTORE" 8 "" "" ""
21 .SH NAME
22 amrestore \- extract backup images from an AMANDA tape
23 .SH "SYNOPSIS"
24 .ad l
25 .hy 0
26 .HP 10
27 \fBamrestore\fR [\fB\-r\fR | \fB\-c\fR | \fB\-C\fR] [\-b\ \fIblocksize\fR] [\-f\ \fIfileno\fR] [\-l\ \fIlabel\fR] [\-p] [\-h] \fB\fItapedevice\fR\fR | \fB\fIholdingfile\fR\fR | \fB\fIhostname\fR\ [\fIdiskname\fR\ [\fIdatestamp\fR\ [\fIhostname\fR\ [\fIdiskname\fR\ [\fIdatestamp\fR...]]]]]\fR 
28 .ad
29 .hy
30
31 .SH "DESCRIPTION"
32
33 .PP
34 \fBAmrestore\fR extracts backup images from the tape mounted on \fBtapedevice\fR or from the holding disk file \fBholdingfile\fR that match \fBhostname\fR, \fBdiskname\fR and \fBdatestamp\fR patterns given on the command line\&. The tape or holding file must be in a format written by the \fBamdump\fR or \fBamflush\fR program\&.
35
36 .PP
37 If \fBdiskname\fR is not specified, all backups on the tape for the previous \fBhostname\fR are candidates\&. If \fBdatestamp\fR is not specified, all backups on the tape for the previous \fBhostname\fR and \fBdiskname\fR are candidates\&. If no \fBhostname\fR, \fBdiskname\fR or \fBdatestamp\fR are specified, every backup on the tape is a candidate\&.
38
39 .PP
40 \fBHostname\fR and \fBdiskname\fR are special expressions described in the "HOST & DISK EXPRESSION" section of \fBamanda\fR(8)\&. \fBDatestamp\fR are special expression described in the "DATESTAMP EXPRESSION" section of \fBamanda\fR(8)\&. For example, if \fBdiskname\fR is "rz[23]a", it would match disks \fBrz2a\fR and \fBrz3a\fR\&.
41
42 .PP
43 \fBDatestamp\fR is useful if \fBamflush\fR writes multiple backup runs to a single tape\&.
44
45 .PP
46 Unless \fB\-p\fR is used, candidate backup images are extracted to files in the current directory named:
47
48 .PP
49 \fBhostname\&.diskname\&.datestamp\&.dumplevel\fR
50
51 .PP
52 Amrestore doesn't use a changer, it restore from the tape already loaded in the \fBtapedevice\&.\fR
53
54 .SH "OPTIONS"
55
56 .TP
57 \fB\-b\fR
58 Set the blocksize used to read the tape or holding file\&. All holding files must be read with a blocksize of 32 KBytes\&. \fBAmrestore\fR should normally be able to determine the blocksize for tapes on its own and not need this parameter\&.
59
60 .PP
61 The default is 32 KBytes\&.
62
63 .TP
64 \fB\-f\fR
65 Do a rewind followed by a fsf <fileno> before trying to restore an image\&.
66
67 .TP
68 \fB\-l\fR
69 Check if we restoring from the tape with the right \fBlabel\fR
70
71 .TP
72 \fB\-p\fR
73 Pipe output\&. The first matching backup image is sent to standard output, which is normally a pipe to \fBrestore\fR or \fBtar\fR, then \fBamrestore\fR quits\&. It may be run again to continue selecting backups to process\&. Make sure you specify the no\-rewind \fBtapedevice\fR when doing this\&.
74
75 .PP
76 Note: \fBrestore\fR may report "short read" errors when reading from a pipe\&. Most versions of \fBrestore\fR support a blocking factor option to let you set the read block size, and you should set it to 2\&. See the example below\&.
77
78 .TP
79 \fB\-c\fR
80 Compress output using the fastest method the compression program provides\&. \fBAmrestore\fR normally writes output files in a format understood by \fBrestore\fR or \fBtar\fR, even if the backups on the tape are compressed\&. With the \fB\-c\fR or \fB\-C\fR option, \fBamrestore\fR writes all files in compressed format, even if the backups on the tape are not compressed\&. Output file names will have a \&.Z or \&.gz extension depending on whether \fBcompress\fR or \fBgzip\fR is the preferred compression program\&. This option is useful when the current directory disk is small\&.
81
82 .TP
83 \fB\-C\fR
84 Compress output using the best method the compression program provides (may be very CPU intensive)\&. See the notes above about the \fB\-c\fR option\&.
85
86 .TP
87 \fB\-r\fR
88 Raw output\&. Backup images are output exactly as they are on the tape, including the \fBamdump\fR headers\&. Output file names will have a \&.RAW extension\&. This option is only useful for debugging and other strange circumstances\&.
89
90 .TP
91 \fB\-h\fR
92 Header output\&. The tape header block is output at the beginning of each file\&. This is like \fB\-r\fR except \fB\-c\fR or \fB\-C\fR may also be used to compress the result\&. \fBAmrecover\fR uses the header to determine the restore program to use\&.
93
94 .PP
95 If a header is written (\-r or \-h), only 32 KBytes are output regardless of the tape blocksize\&. This makes the resulting image usable as a holding file\&.
96
97 .SH "EXAMPLES"
98
99 .PP
100 The following does an interactive restore of disk \fBrz3g\fR from host \fBseine\fR, to restore particular files\&. Note the use of the \fBb\fR option to \fBrestore\fR, which causes it to read in units of two 512\-byte blocks (1 Kbyte) at a time\&. This helps keep it from complaining about short reads\&.
101
102 .nf
103
104 % amrestore \-p /dev/nrmt9 seine rz3g | restore \-ivbf 2 \-
105
106 .fi
107
108 .PP
109 The next example extracts all backup images for host \fBseine\fR\&. This is the usual way to extract all data for a host after a disk crash\&.
110
111 .nf
112
113 % amrestore /dev/nrmt9 seine
114
115 .fi
116
117 .PP
118 If the backup datestamp in the above example is 19910125 and \fBseine\fR has level 0 backups of disks \fBrz1a\fR and \fBrz1g\fR on the tape, these files will be created in the current directory:
119
120 .nf
121
122 seine\&.rz1a\&.19910125\&.0
123 seine\&.rz1g\&.19910125\&.0
124
125 .fi
126
127 .PP
128 You may also use \fBamrestore\fR to extract a backup image from a holding disk file that has not yet been flushed to tape:
129
130 .nf
131
132 % amrestore \-p /amanda/20001119/seine\&.rz1a\&.2 | restore \-ivbf 2 \-
133
134 .fi
135
136 .PP
137 \fBAmrestore\fR may be used to generate a listing of images on a tape:
138
139 .nf
140
141 % mt \-f /dev/nrmt9 rewind
142 % amrestore \-p /dev/nrmt9 no\-such\-host > /dev/null
143
144 .fi
145
146 .PP
147 This asks \fBamrestore\fR to find images for host \fBno\-such\-host\fR\&. It will not find any entries that match, but along the way will report each image it skips\&.
148
149 .SH "CAVEATS"
150
151 .PP
152 \fBGNU\-tar\fR must be used to restore files from backup images created with the GNUTAR dumptype\&. Vendor tar programs sometimes fail to read GNU tar images\&.
153
154 .SH "AUTHOR"
155
156 .PP
157 James da Silva, <jds@amanda\&.org>, University of Maryland, College Park: Original text
158
159 .PP
160 Stefan G\&. Weichinger, <sgw@amanda\&.org>, maintainer of the \fBAMANDA\fR\-documentation: XML\-conversion
161
162 .SH "SEE ALSO"
163
164 .PP
165 \fBamanda\fR(8), \fBamdump\fR(8), \fBamflush\fR(8), \fBtar\fR(1)  \fBrestore\fR(8)
166