Imported Upstream version 3.2.0
[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 vsnapshot_8273 <http://docbook.sf.net/>
5 .\"      Date: 10/18/2010
6 .\"    Manual: Miscellanea
7 .\"    Source: Amanda 3.2.0
8 .\"  Language: English
9 .\"
10 .TH "AMANDA\-MATCH" "7" "10/18/2010" "Amanda 3\&.2\&.0" "Miscellanea"
11 .\" -----------------------------------------------------------------
12 .\" * set default formatting
13 .\" -----------------------------------------------------------------
14 .\" disable hyphenation
15 .nh
16 .\" disable justification (adjust text to left margin only)
17 .ad l
18 .\" -----------------------------------------------------------------
19 .\" * MAIN CONTENT STARTS HERE *
20 .\" -----------------------------------------------------------------
21 .SH "NAME"
22 amanda-match \- Common Amanda Match Expression
23 .SH "DESCRIPTION"
24 .PP
25 Several Amanda commands allow the user to specify dumps using "match expressions"\&. This manual page describes the syntax of these expressions\&.
26 .PP
27 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\&.
28 .SH "HOST & DISK EXPRESSIONS"
29 .PP
30 The hosts and disks match by word\&. Each word is a glob expression, and words are separated by the character \'\&.\' for host expressions and \'/\' for disk expressions\&. You can anchor the expression on the left with a \'^\' or on the right with a \'$\'\&. 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\&.
31 .PP
32 If the disk is a UNC ("\e\ewindows\eshare") then all \'\e\' are converted to \'/\' before the match\&. Using \'\e\' is complicated because of the extra quoting required by the shell and amanda\&. It\'s easier to use \'/\' because it requires less quoting ("//windows/share")
33 .PP
34 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\&.
35 .PP
36 dot (\&.)
37 .RS 4
38 word separator for a host
39 .RE
40 .PP
41 /
42 .RS 4
43 word separator for a disk
44 .RE
45 .PP
46 \e
47 .RS 4
48 word separator for a UNC disk
49 .RE
50 .PP
51 ^
52 .RS 4
53 anchor at left of word
54 .RE
55 .PP
56 $
57 .RS 4
58 anchor at right of word
59 .RE
60 .PP
61 ?
62 .RS 4
63 match exactly one character except the separator
64 .RE
65 .PP
66 *
67 .RS 4
68 match zero or more characters except the separator
69 .RE
70 .PP
71 **
72 .RS 4
73 match zero or more characters including the separator
74 .RE
75 .PP
76 [\&.\&.\&.]
77 .RS 4
78 match exactly one of the characters enclosed by the brackets\&.
79 .RE
80 .PP
81 [!\&.\&.\&.]
82 .RS 4
83 match exactly one character that is not enclosed by the brackets\&.
84 .RE
85 .SS "Examples"
86 .PP
87 hosta
88 .RS 4
89 Will match
90 hosta,
91 foo\&.hosta\&.org, and
92 hoSTA\&.dOMAIna\&.ORG
93 but not
94 hostb\&.
95 .RE
96 .PP
97 host
98 .RS 4
99 Will match
100 host
101 but not
102 hosta\&.
103 .RE
104 .PP
105 host?
106 .RS 4
107 Will match
108 hosta
109 and
110 hostb, but not
111 host
112 or
113 hostabc\&.
114 .RE
115 .PP
116 ho*na
117 .RS 4
118 Will match
119 hoina
120 but not
121 ho\&.aina\&.org\&.
122 .RE
123 .PP
124 ho**na
125 .RS 4
126 Will match
127 hoina
128 and
129 ho\&.aina\&.org\&.
130 .RE
131 .PP
132 ^hosta
133 .RS 4
134 Will match
135 hosta
136 but not
137 foo\&.hosta\&.org\&.
138 .RE
139 .PP
140 sda*
141 .RS 4
142 Will match
143 /dev/sda1
144 and
145 /dev/sda12\&.
146 .RE
147 .PP
148 /opt
149 .RS 4
150 Will match the disk
151 opt
152 but not the host
153 opt\&.
154 .RE
155 .PP
156 (note dots:) \&.opt\&.
157 .RS 4
158 Will match the host
159 opt
160 but not the disk
161 opt\&.
162 .RE
163 .PP
164 /
165 .RS 4
166 Will match the disk
167 /
168 but no other disk\&.
169 .RE
170 .PP
171 /usr
172 .RS 4
173 Will match the disks
174 /usr
175 and
176 /usr/local\&.
177 .RE
178 .PP
179 /usr$
180 .RS 4
181 Will match the disks
182 /usr
183 but not
184 /usr/local\&.
185 .RE
186 .PP
187 share
188 .RS 4
189 Will match the disks
190 \e\ewindows1\eshare
191 and
192 \e\ewindows2\eshare\&.
193 .RE
194 .PP
195 share*
196 .RS 4
197 Will match the disks
198 \e\ewindows\eshare1
199 and
200 \e\ewindows\eshare2\&.
201 .RE
202 .PP
203 //windows/share
204 .RS 4
205 Will match the disk
206 \e\ewindows\eshare\&.
207 .RE
208 .SH "DATESTAMP EXPRESSIONS"
209 .PP
210 A datestamp expression is either a prefix of the datestamp, or a range expression (separated by \'\-\') matching several prefixes\&. A leading ^ is removed, while arailing $ will force an exact match\&.
211 .SS "Examples"
212 .PP
213 20001212\-14
214 .RS 4
215 match all dates beginning with 20001212, 20001213 or 20001214
216 .RE
217 .PP
218 20001212\-4
219 .RS 4
220 same as previous
221 .RE
222 .PP
223 20001212\-24
224 .RS 4
225 match all dates between 20001212 and 20001224
226 .RE
227 .PP
228 2000121
229 .RS 4
230 match all dates that start with 2000121 (20001210\-20001219)
231 .RE
232 .PP
233 2
234 .RS 4
235 match all dates that start with 2 (20000101\-29991231)
236 .RE
237 .PP
238 2000\-10
239 .RS 4
240 match all dates between 20000101\-20101231
241 .RE
242 .PP
243 200010$
244 .RS 4
245 match only 200010
246 .RE
247 .SH "LEVEL EXPRESSIONS"
248 .PP
249 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\&.
250 .SH "DUMP SPECIFICATIONS"
251 .PP
252 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\&.
253 .SS "Examples"
254 .PP
255 amtool MyConfig ^vpdesktop$
256 .RS 4
257 all dumps of host "vpdesktop"
258 .RE
259 .PP
260 amtool MyConfig \'*\' /var/stage
261 .RS 4
262 All dumps of
263 /var/stage
264 on any host
265 .RE
266 .PP
267 amtool MyConfig www1 /var/www \'*\' www2 /var/www \'*\'
268 .RS 4
269 All dumps of /var/www on www1 and www2 (assuming amtool does not require a level argument)
270 .RE
271 .SH "DLE SPECIFICATIONS"
272 .PP
273 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
274 \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\&.
275 .SS "Examples"
276 .PP
277 amtool MyConfig vpdesktop /home/anderson
278 .RS 4
279 /home/anderson
280 on host vpdesktop
281 .RE
282 .PP
283 amtool MyConfig \'*\' ^/etc \'*\' ^/var
284 .RS 4
285 All DLEs matching
286 ^/var
287 or
288 ^/etc
289 on any host
290 .RE
291 .PP
292 amtool MyConfig web1 www web2 www
293 .RS 4
294 If no host matches "www", all DLEs matching
295 www
296 on hosts web1 and web2\&. If a host matches "www", then all DLEs on hosts www, web1, and web2\&.
297 .RE
298 .SH "SEE ALSO"
299 .PP
300 \fBamanda\fR(8),
301 \fBamanda\fR(8),
302 \fBamfetchdump\fR(8),
303 \fBamrestore\fR(8),
304 \fBamadmin\fR(8),
305 \fBamvault\fR(8),
306 \fBamflush\fR(8),
307 \fBamdump\fR(8)
308 .PP
309 The Amanda Wiki:
310 : http://wiki.zmanda.com/
311 .SH "AUTHOR"
312 .PP
313 \fBDustin J\&. Mitchell\fR <\&dustin@zmanda\&.com\&>
314 .RS 4
315 Zmanda, Inc\&. (http://www\&.zmanda\&.com)
316 .RE