Imported Upstream version 3.3.2
[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: 07/25/2012
6 .\"    Manual: Miscellanea
7 .\"    Source: Amanda 3.3.2
8 .\"  Language: English
9 .\"
10 .TH "AMANDA\-MATCH" "7" "07/25/2012" "Amanda 3\&.3\&.2" "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 .SH "HOST & DISK EXPRESSIONS"
38 .PP
39 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\&.
40 .PP
41 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")
42 .PP
43 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\&.
44 .PP
45 dot (\&.)
46 .RS 4
47 word separator for a host
48 .RE
49 .PP
50 /
51 .RS 4
52 word separator for a disk
53 .RE
54 .PP
55 \e
56 .RS 4
57 word separator for a UNC disk
58 .RE
59 .PP
60 ^
61 .RS 4
62 anchor at left of word
63 .RE
64 .PP
65 $
66 .RS 4
67 anchor at right of word
68 .RE
69 .PP
70 ?
71 .RS 4
72 match exactly one character except the separator
73 .RE
74 .PP
75 *
76 .RS 4
77 match zero or more characters except the separator
78 .RE
79 .PP
80 **
81 .RS 4
82 match zero or more characters including the separator
83 .RE
84 .PP
85 [\&.\&.\&.]
86 .RS 4
87 match exactly one of the characters enclosed by the brackets\&.
88 .RE
89 .PP
90 [!\&.\&.\&.]
91 .RS 4
92 match exactly one character that is not enclosed by the brackets\&.
93 .RE
94 .SS "Examples"
95 .PP
96 hosta
97 .RS 4
98 Will match
99 hosta,
100 foo\&.hosta\&.org, and
101 hoSTA\&.dOMAIna\&.ORG
102 but not
103 hostb\&.
104 .RE
105 .PP
106 host
107 .RS 4
108 Will match
109 host
110 but not
111 hosta\&.
112 .RE
113 .PP
114 host?
115 .RS 4
116 Will match
117 hosta
118 and
119 hostb, but not
120 host
121 or
122 hostabc\&.
123 .RE
124 .PP
125 ho*na
126 .RS 4
127 Will match
128 hoina
129 but not
130 ho\&.aina\&.org\&.
131 .RE
132 .PP
133 ho**na
134 .RS 4
135 Will match
136 hoina
137 and
138 ho\&.aina\&.org\&.
139 .RE
140 .PP
141 ^hosta
142 .RS 4
143 Will match
144 hosta
145 but not
146 foo\&.hosta\&.org\&.
147 .RE
148 .PP
149 sda*
150 .RS 4
151 Will match
152 /dev/sda1
153 and
154 /dev/sda12\&.
155 .RE
156 .PP
157 /opt
158 .RS 4
159 Will match the disk
160 opt
161 but not the host
162 opt\&.
163 .RE
164 .PP
165 (note dots:) \&.opt\&.
166 .RS 4
167 Will match the host
168 opt
169 but not the disk
170 opt\&.
171 .RE
172 .PP
173 /
174 .RS 4
175 Will match the disk
176 /
177 but no other disk\&.
178 .RE
179 .PP
180 /usr
181 .RS 4
182 Will match the disks
183 /usr
184 and
185 /usr/local\&.
186 .RE
187 .PP
188 /usr$
189 .RS 4
190 Will match the disks
191 /usr
192 but not
193 /usr/local\&.
194 .RE
195 .PP
196 share
197 .RS 4
198 Will match the disks
199 \e\ewindows1\eshare
200 and
201 \e\ewindows2\eshare\&.
202 .RE
203 .PP
204 share*
205 .RS 4
206 Will match the disks
207 \e\ewindows\eshare1
208 and
209 \e\ewindows\eshare2\&.
210 .RE
211 .PP
212 //windows/share
213 .RS 4
214 Will match the disk
215 \e\ewindows\eshare\&.
216 .RE
217 .SH "DATESTAMP EXPRESSIONS"
218 .PP
219 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\&.
220 .SS "Examples"
221 .PP
222 20001212\-14
223 .RS 4
224 match all dates beginning with 20001212, 20001213 or 20001214
225 .RE
226 .PP
227 20001212\-4
228 .RS 4
229 same as previous
230 .RE
231 .PP
232 20001212\-24
233 .RS 4
234 match all dates between 20001212 and 20001224
235 .RE
236 .PP
237 2000121
238 .RS 4
239 match all dates that start with 2000121 (20001210\-20001219)
240 .RE
241 .PP
242 2
243 .RS 4
244 match all dates that start with 2 (20000101\-29991231)
245 .RE
246 .PP
247 2000\-10
248 .RS 4
249 match all dates between 20000101\-20101231
250 .RE
251 .PP
252 200010$
253 .RS 4
254 match only 200010
255 .RE
256 .SH "LEVEL EXPRESSIONS"
257 .PP
258 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\&.
259 .SH "DUMP SPECIFICATIONS"
260 .PP
261 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\&.
262 .SS "Examples"
263 .PP
264 amtool MyConfig ^vpdesktop$
265 .RS 4
266 all dumps of host "vpdesktop"
267 .RE
268 .PP
269 amtool MyConfig \*(Aq*\*(Aq /var/stage
270 .RS 4
271 All dumps of
272 /var/stage
273 on any host
274 .RE
275 .PP
276 amtool MyConfig www1 /var/www \*(Aq*\*(Aq www2 /var/www \*(Aq*\*(Aq
277 .RS 4
278 All dumps of /var/www on www1 and www2 (assuming amtool does not require a level argument)
279 .RE
280 .SH "DLE SPECIFICATIONS"
281 .PP
282 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
283 \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\&.
284 .SS "Examples"
285 .PP
286 amtool MyConfig vpdesktop /home/anderson
287 .RS 4
288 /home/anderson
289 on host vpdesktop
290 .RE
291 .PP
292 amtool MyConfig \*(Aq*\*(Aq ^/etc \*(Aq*\*(Aq ^/var
293 .RS 4
294 All DLEs matching
295 ^/var
296 or
297 ^/etc
298 on any host
299 .RE
300 .PP
301 amtool MyConfig web1 www web2 www
302 .RS 4
303 If no host matches "www", all DLEs matching
304 www
305 on hosts web1 and web2\&. If a host matches "www", then all DLEs on hosts www, web1, and web2\&.
306 .RE
307 .SH "SEE ALSO"
308 .PP
309 \fBamanda\fR(8),
310 \fBamanda\fR(8),
311 \fBamfetchdump\fR(8),
312 \fBamrestore\fR(8),
313 \fBamadmin\fR(8),
314 \fBamvault\fR(8),
315 \fBamflush\fR(8),
316 \fBamdump\fR(8)
317 .PP
318 The Amanda Wiki:
319 : http://wiki.zmanda.com/
320 .SH "AUTHOR"
321 .PP
322 \fBDustin J\&. Mitchell\fR <\&dustin@zmanda\&.com\&>
323 .RS 4
324 Zmanda, Inc\&. (http://www\&.zmanda\&.com)
325 .RE