1 <?xml version="1.0" encoding="ISO-8859-1"?>
2 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
3 "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd"
5 <!-- entities files to use -->
6 <!ENTITY % global_entities SYSTEM 'global.entities'>
10 <refentry id='amanda-match.7'>
13 <refentrytitle>amanda-match</refentrytitle>
14 <manvolnum>7</manvolnum>
20 <refname>amanda-match</refname>
21 <refpurpose>Common Amanda Match Expression</refpurpose>
26 <!-- body begins here -->
28 <refsect1><title>DESCRIPTION</title>
30 <para>Several Amanda commands allow the user to specify dumps using "match
31 expressions". This manual page describes the syntax of these
34 <para>In some places, only certain match expressions are allowed. However,
35 several commands take a dump specification ("dumpspec") consisting of a
36 sequence of several expressions intended to match particular dumps in the
37 catalog. Other applications take a DLE specification which indicates a set
38 of DLEs to be operated on. These formats are described below.</para>
40 <para>An expression can be disabled be preceding it with the '=' character,
41 in that case, an exact match is used.</para>
42 <para>Many program have an '--exact-match' argument that disable expression and exact match are used.</para>
45 <refsect1><title>HOST & DISK EXPRESSIONS</title>
47 <para>The hosts and disks match by word. Each word is a glob expression, and words
48 are separated by the character '.' for host expressions and '/' for disk expressions. You
49 can anchor the expression on the left with a '^' or on the right with a '$'. The matcher
50 is case insensitive for hosts but case sensitive for disks. A match
51 succeeds if all words in the expression match contiguous words in
52 the host or disk.</para>
54 <para>If the disk is a UNC ("\\windows\share") then all '\' are converted to
55 '/' before the match. Using '\' is complicated because of the extra
56 quoting required by the shell and amanda. It's easier to use '/' because it
57 requires less quoting ("//windows/share")</para>
59 <para>The special characters follow. Note that the shell interprets some of
60 these characters, so when used on the command line, they must be escaped
61 appropriately for the shell.</para>
63 <variablelist remap='TP'>
66 <term>dot (.)</term> <!-- troff gets confused by a plain dot -->
67 <listitem><para>word separator for a host</para></listitem>
72 <listitem><para>word separator for a disk</para></listitem>
77 <listitem><para>word separator for a UNC disk</para></listitem>
82 <listitem><para>anchor at left of word</para></listitem>
87 <listitem><para>anchor at right of word</para></listitem>
92 <listitem><para>match exactly one character except the separator</para></listitem>
97 <listitem><para>match zero or more characters except the separator</para></listitem>
102 <listitem><para>match zero or more characters including the separator</para></listitem>
107 <listitem><para>match exactly one of the characters enclosed by the brackets.</para></listitem>
112 <listitem><para>match exactly one character that is not enclosed by the brackets.</para></listitem>
117 <refsect2><title>Examples</title>
119 <variablelist remap='TP'>
123 Will match <filename>hosta</filename>, <filename>foo.hosta.org</filename>, and
124 <filename>hoSTA.dOMAIna.ORG</filename> but not <filename>hostb</filename>.
131 Will match <filename>host</filename> but not <filename>hosta</filename>.
138 Will match <filename>hosta</filename> and <filename>hostb</filename>, but
139 not <filename>host</filename> or <filename>hostabc</filename>.
146 Will match <filename>hoina</filename>
147 but not <filename>ho.aina.org</filename>.
154 Will match <filename>hoina</filename>
155 and <filename>ho.aina.org</filename>.
162 Will match <filename>hosta</filename>
163 but not <filename>foo.hosta.org</filename>.
170 Will match <filename>/dev/sda1</filename>
171 and <filename>/dev/sda12</filename>.
178 Will match the disk <filename>opt</filename>
179 but not the host <filename>opt</filename>.
184 <term>(note dots:) .opt.</term> <!-- nroff gets confused by dots -->
186 Will match the host <filename>opt</filename>
187 but not the disk <filename>opt</filename>.
194 Will match the disk <filename>/</filename>
202 Will match the disks <filename>/usr</filename>
203 and <filename>/usr/local</filename>.
210 Will match the disks <filename>/usr</filename>
211 but not <filename>/usr/local</filename>.
218 Will match the disks <filename>\\windows1\share</filename> and <filename>\\windows2\share</filename>.
225 Will match the disks <filename>\\windows\share1</filename> and <filename>\\windows\share2</filename>.
230 <term>//windows/share</term>
232 Will match the disk <filename>\\windows\share</filename>.
242 <refsect1><title>DATESTAMP EXPRESSIONS</title>
244 <para>A datestamp expression is either a prefix of the datestamp, or a range
245 expression (separated by '-') matching several prefixes. A leading ^ is
246 removed, while arailing $ will force an exact match.</para>
248 <refsect2><title>Examples</title>
250 <variablelist remap="TP">
253 <term>20001212-14</term>
254 <listitem><para>match all dates beginning with 20001212, 20001213 or 20001214</para></listitem>
258 <term>20001212-4</term>
259 <listitem><para>same as previous</para></listitem>
263 <term>20001212-24</term>
264 <listitem><para>match all dates between 20001212 and 20001224</para></listitem>
269 <listitem><para>match all dates that start with 2000121 (20001210-20001219)</para></listitem>
274 <listitem><para>match all dates that start with 2 (20000101-29991231)</para></listitem>
279 <listitem><para>match all dates between 20000101-20101231</para></listitem>
284 <listitem><para>match only 200010</para></listitem>
293 <refsect1><title>LEVEL EXPRESSIONS</title>
295 <para>Level expressions are either prefix matches e.g., "1", which matches "1",
296 "10", and "123", absolute matches e.g., "3$" which only matches "3", or a
297 range e.g., "3-5" which only matches levels 3, 4, and 5.</para>
301 <refsect1><title>DUMP SPECIFICATIONS</title>
303 <para>A dump specification is used to select one or more dumps from the
304 catalog. It consists of a sequence of match expressions in the order host,
305 disk, datestamp, and level. Note that some commands do not take a level
306 argument, out of historical accident. Note, too, that the datestamp
307 expression matches the time that the dump was made on the Amanda client,
308 rather than the date it was moved to tape.</para>
310 <refsect2><title>Examples</title>
312 <variablelist remap='TP'>
314 <term>amtool MyConfig ^vpdesktop$</term>
315 <listitem><para>all dumps of host "vpdesktop"</para></listitem>
319 <term>amtool MyConfig '*' /var/stage</term>
320 <listitem><para>All dumps of <filename>/var/stage</filename> on any host</para></listitem>
324 <term>amtool MyConfig www1 /var/www '*' www2 /var/www '*'</term>
325 <listitem><para>All dumps of /var/www on www1 and www2 (assuming amtool does not
326 require a level argument)</para></listitem>
334 <refsect1><title>DLE SPECIFICATIONS</title>
336 <para>A DLE specification is used to select one or more DLEs. It consists of a
337 sequence of match expressions. The first must be a host, and subsequent
338 expressions will be experimentally matched against both hosts and disks in
339 the &disklist;, preferring hosts. This dynamic matching process can lead
340 to odd behavior in extreme cases (e.g., where a disk and a host have the
341 same name), but for most uses does exactly what is expected.</para>
343 <refsect2><title>Examples</title>
345 <variablelist remap='TP'>
347 <term>amtool MyConfig vpdesktop /home/anderson</term>
348 <listitem><para><filename>/home/anderson</filename> on host vpdesktop</para></listitem>
352 <term>amtool MyConfig '*' ^/etc '*' ^/var</term>
353 <listitem><para>All DLEs matching <filename>^/var</filename> or
354 <filename>^/etc</filename> on any host</para></listitem>
358 <term>amtool MyConfig web1 www web2 www</term>
359 <listitem><para>If no host matches "www", all DLEs matching
360 <filename>www</filename> on hosts web1 and web2. If a host
361 matches "www", then all DLEs on hosts www, web1, and web2.
371 <manref name="amanda" vol="8"/>,
372 <manref name="amfetchdump" vol="8"/>,
373 <manref name="amrestore" vol="8"/>,
374 <manref name="amadmin" vol="8"/>,
375 <manref name="amvault" vol="8"/>
376 <manref name="amflush" vol="8"/>
377 <manref name="amdump" vol="8"/>