Imported Upstream version 3.3.3
[debian/amanda] / man / amanda-match.7
1 '\" t
2 .\"     Title: amanda-match
3 .\"    Author: Dustin J. Mitchell <dustin@zmanda.com>
4 .\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
5 .\"      Date: 01/10/2013
6 .\"    Manual: Miscellanea
7 .\"    Source: Amanda 3.3.3
8 .\"  Language: English
9 .\"
10 .TH "AMANDA\-MATCH" "7" "01/10/2013" "Amanda 3\&.3\&.3" "Miscellanea"
11 .\" -----------------------------------------------------------------
12 .\" * Define some portability stuff
13 .\" -----------------------------------------------------------------
14 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15 .\" http://bugs.debian.org/507673
16 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
17 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
18 .ie \n(.g .ds Aq \(aq
19 .el       .ds Aq '
20 .\" -----------------------------------------------------------------
21 .\" * set default formatting
22 .\" -----------------------------------------------------------------
23 .\" disable hyphenation
24 .nh
25 .\" disable justification (adjust text to left margin only)
26 .ad l
27 .\" -----------------------------------------------------------------
28 .\" * MAIN CONTENT STARTS HERE *
29 .\" -----------------------------------------------------------------
30 .SH "NAME"
31 amanda-match \- Common Amanda Match Expression
32 .SH "DESCRIPTION"
33 .PP
34 Several Amanda commands allow the user to specify dumps using "match expressions"\&. This manual page describes the syntax of these expressions\&.
35 .PP
36 In some places, only certain match expressions are allowed\&. However, several commands take a dump specification ("dumpspec") consisting of a sequence of several expressions intended to match particular dumps in the catalog\&. Other applications take a DLE specification which indicates a set of DLEs to be operated on\&. These formats are described below\&.
37 .PP
38 An expression can be disabled be preceding it with the \*(Aq=\*(Aq character, in that case, an exact match is used\&.
39 .PP
40 Many program have an \*(Aq\-\-exact\-match\*(Aq argument that disable expression and exact match are used\&.
41 .SH "HOST & DISK EXPRESSIONS"
42 .PP
43 The hosts and disks match by word\&. Each word is a glob expression, and words are separated by the character \*(Aq\&.\*(Aq for host expressions and \*(Aq/\*(Aq for disk expressions\&. You can anchor the expression on the left with a \*(Aq^\*(Aq or on the right with a \*(Aq$\*(Aq\&. The matcher is case insensitive for hosts but case sensitive for disks\&. A match succeeds if all words in the expression match contiguous words in the host or disk\&.
44 .PP
45 If the disk is a UNC ("\e\ewindows\eshare") then all \*(Aq\e\*(Aq are converted to \*(Aq/\*(Aq before the match\&. Using \*(Aq\e\*(Aq is complicated because of the extra quoting required by the shell and amanda\&. It\*(Aqs easier to use \*(Aq/\*(Aq because it requires less quoting ("//windows/share")
46 .PP
47 The special characters follow\&. Note that the shell interprets some of these characters, so when used on the command line, they must be escaped appropriately for the shell\&.
48 .PP
49 dot (\&.)
50 .RS 4
51 word separator for a host
52 .RE
53 .PP
54 /
55 .RS 4
56 word separator for a disk
57 .RE
58 .PP
59 \e
60 .RS 4
61 word separator for a UNC disk
62 .RE
63 .PP
64 ^
65 .RS 4
66 anchor at left of word
67 .RE
68 .PP
69 $
70 .RS 4
71 anchor at right of word
72 .RE
73 .PP
74 ?
75 .RS 4
76 match exactly one character except the separator
77 .RE
78 .PP
79 *
80 .RS 4
81 match zero or more characters except the separator
82 .RE
83 .PP
84 **
85 .RS 4
86 match zero or more characters including the separator
87 .RE
88 .PP
89 [\&.\&.\&.]
90 .RS 4
91 match exactly one of the characters enclosed by the brackets\&.
92 .RE
93 .PP
94 [!\&.\&.\&.]
95 .RS 4
96 match exactly one character that is not enclosed by the brackets\&.
97 .RE
98 .SS "Examples"
99 .PP
100 hosta
101 .RS 4
102 Will match
103 hosta,
104 foo\&.hosta\&.org, and
105 hoSTA\&.dOMAIna\&.ORG
106 but not
107 hostb\&.
108 .RE
109 .PP
110 host
111 .RS 4
112 Will match
113 host
114 but not
115 hosta\&.
116 .RE
117 .PP
118 host?
119 .RS 4
120 Will match
121 hosta
122 and
123 hostb, but not
124 host
125 or
126 hostabc\&.
127 .RE
128 .PP
129 ho*na
130 .RS 4
131 Will match
132 hoina
133 but not
134 ho\&.aina\&.org\&.
135 .RE
136 .PP
137 ho**na
138 .RS 4
139 Will match
140 hoina
141 and
142 ho\&.aina\&.org\&.
143 .RE
144 .PP
145 ^hosta
146 .RS 4
147 Will match
148 hosta
149 but not
150 foo\&.hosta\&.org\&.
151 .RE
152 .PP
153 sda*
154 .RS 4
155 Will match
156 /dev/sda1
157 and
158 /dev/sda12\&.
159 .RE
160 .PP
161 /opt
162 .RS 4
163 Will match the disk
164 opt
165 but not the host
166 opt\&.
167 .RE
168 .PP
169 (note dots:) \&.opt\&.
170 .RS 4
171 Will match the host
172 opt
173 but not the disk
174 opt\&.
175 .RE
176 .PP
177 /
178 .RS 4
179 Will match the disk
180 /
181 but no other disk\&.
182 .RE
183 .PP
184 /usr
185 .RS 4
186 Will match the disks
187 /usr
188 and
189 /usr/local\&.
190 .RE
191 .PP
192 /usr$
193 .RS 4
194 Will match the disks
195 /usr
196 but not
197 /usr/local\&.
198 .RE
199 .PP
200 share
201 .RS 4
202 Will match the disks
203 \e\ewindows1\eshare
204 and
205 \e\ewindows2\eshare\&.
206 .RE
207 .PP
208 share*
209 .RS 4
210 Will match the disks
211 \e\ewindows\eshare1
212 and
213 \e\ewindows\eshare2\&.
214 .RE
215 .PP
216 //windows/share
217 .RS 4
218 Will match the disk
219 \e\ewindows\eshare\&.
220 .RE
221 .SH "DATESTAMP EXPRESSIONS"
222 .PP
223 A datestamp expression is either a prefix of the datestamp, or a range expression (separated by \*(Aq\-\*(Aq) matching several prefixes\&. A leading ^ is removed, while arailing $ will force an exact match\&.
224 .SS "Examples"
225 .PP
226 20001212\-14
227 .RS 4
228 match all dates beginning with 20001212, 20001213 or 20001214
229 .RE
230 .PP
231 20001212\-4
232 .RS 4
233 same as previous
234 .RE
235 .PP
236 20001212\-24
237 .RS 4
238 match all dates between 20001212 and 20001224
239 .RE
240 .PP
241 2000121
242 .RS 4
243 match all dates that start with 2000121 (20001210\-20001219)
244 .RE
245 .PP
246 2
247 .RS 4
248 match all dates that start with 2 (20000101\-29991231)
249 .RE
250 .PP
251 2000\-10
252 .RS 4
253 match all dates between 20000101\-20101231
254 .RE
255 .PP
256 200010$
257 .RS 4
258 match only 200010
259 .RE
260 .SH "LEVEL EXPRESSIONS"
261 .PP
262 Level expressions are either prefix matches e\&.g\&., "1", which matches "1", "10", and "123", absolute matches e\&.g\&., "3$" which only matches "3", or a range e\&.g\&., "3\-5" which only matches levels 3, 4, and 5\&.
263 .SH "DUMP SPECIFICATIONS"
264 .PP
265 A dump specification is used to select one or more dumps from the catalog\&. It consists of a sequence of match expressions in the order host, disk, datestamp, and level\&. Note that some commands do not take a level argument, out of historical accident\&. Note, too, that the datestamp expression matches the time that the dump was made on the Amanda client, rather than the date it was moved to tape\&.
266 .SS "Examples"
267 .PP
268 amtool MyConfig ^vpdesktop$
269 .RS 4
270 all dumps of host "vpdesktop"
271 .RE
272 .PP
273 amtool MyConfig \*(Aq*\*(Aq /var/stage
274 .RS 4
275 All dumps of
276 /var/stage
277 on any host
278 .RE
279 .PP
280 amtool MyConfig www1 /var/www \*(Aq*\*(Aq www2 /var/www \*(Aq*\*(Aq
281 .RS 4
282 All dumps of /var/www on www1 and www2 (assuming amtool does not require a level argument)
283 .RE
284 .SH "DLE SPECIFICATIONS"
285 .PP
286 A DLE specification is used to select one or more DLEs\&. It consists of a sequence of match expressions\&. The first must be a host, and subsequent expressions will be experimentally matched against both hosts and disks in the
287 \fBdisklist\fR(5), preferring hosts\&. This dynamic matching process can lead to odd behavior in extreme cases (e\&.g\&., where a disk and a host have the same name), but for most uses does exactly what is expected\&.
288 .SS "Examples"
289 .PP
290 amtool MyConfig vpdesktop /home/anderson
291 .RS 4
292 /home/anderson
293 on host vpdesktop
294 .RE
295 .PP
296 amtool MyConfig \*(Aq*\*(Aq ^/etc \*(Aq*\*(Aq ^/var
297 .RS 4
298 All DLEs matching
299 ^/var
300 or
301 ^/etc
302 on any host
303 .RE
304 .PP
305 amtool MyConfig web1 www web2 www
306 .RS 4
307 If no host matches "www", all DLEs matching
308 www
309 on hosts web1 and web2\&. If a host matches "www", then all DLEs on hosts www, web1, and web2\&.
310 .RE
311 .SH "SEE ALSO"
312 .PP
313 \fBamanda\fR(8),
314 \fBamanda\fR(8),
315 \fBamfetchdump\fR(8),
316 \fBamrestore\fR(8),
317 \fBamadmin\fR(8),
318 \fBamvault\fR(8),
319 \fBamflush\fR(8),
320 \fBamdump\fR(8)
321 .PP
322 The Amanda Wiki:
323 : http://wiki.zmanda.com/
324 .SH "AUTHOR"
325 .PP
326 \fBDustin J\&. Mitchell\fR <\&dustin@zmanda\&.com\&>
327 .RS 4
328 Zmanda, Inc\&. (http://www\&.zmanda\&.com)
329 .RE