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>
42 <refsect1><title>HOST & DISK EXPRESSIONS</title>
44 <para>The hosts and disks match by word. Each word is a glob expression, and words
45 are separated by the character '.' for host expressions and '/' for disk expressions. You
46 can anchor the expression on the left with a '^' or on the right with a '$'. The matcher
47 is case insensitive for hosts but case sensitive for disks. A match
48 succeeds if all words in the expression match contiguous words in
49 the host or disk.</para>
51 <para>If the disk is a UNC ("\\windows\share") then all '\' are converted to
52 '/' before the match. Using '\' is complicated because of the extra
53 quoting required by the shell and amanda. It's easier to use '/' because it
54 requires less quoting ("//windows/share")</para>
56 <para>The special characters follow. Note that the shell interprets some of
57 these characters, so when used on the command line, they must be escaped
58 appropriately for the shell.</para>
60 <variablelist remap='TP'>
63 <term>dot (.)</term> <!-- troff gets confused by a plain dot -->
64 <listitem><para>word separator for a host</para></listitem>
69 <listitem><para>word separator for a disk</para></listitem>
74 <listitem><para>word separator for a UNC disk</para></listitem>
79 <listitem><para>anchor at left of word</para></listitem>
84 <listitem><para>anchor at right of word</para></listitem>
89 <listitem><para>match exactly one character except the separator</para></listitem>
94 <listitem><para>match zero or more characters except the separator</para></listitem>
99 <listitem><para>match zero or more characters including the separator</para></listitem>
104 <listitem><para>match exactly one of the characters enclosed by the brackets.</para></listitem>
109 <listitem><para>match exactly one character that is not enclosed by the brackets.</para></listitem>
114 <refsect2><title>Examples</title>
116 <variablelist remap='TP'>
120 Will match <filename>hosta</filename>, <filename>foo.hosta.org</filename>, and
121 <filename>hoSTA.dOMAIna.ORG</filename> but not <filename>hostb</filename>.
128 Will match <filename>host</filename> but not <filename>hosta</filename>.
135 Will match <filename>hosta</filename> and <filename>hostb</filename>, but
136 not <filename>host</filename> or <filename>hostabc</filename>.
143 Will match <filename>hoina</filename>
144 but not <filename>ho.aina.org</filename>.
151 Will match <filename>hoina</filename>
152 and <filename>ho.aina.org</filename>.
159 Will match <filename>hosta</filename>
160 but not <filename>foo.hosta.org</filename>.
167 Will match <filename>/dev/sda1</filename>
168 and <filename>/dev/sda12</filename>.
175 Will match the disk <filename>opt</filename>
176 but not the host <filename>opt</filename>.
181 <term>(note dots:) .opt.</term> <!-- nroff gets confused by dots -->
183 Will match the host <filename>opt</filename>
184 but not the disk <filename>opt</filename>.
191 Will match the disk <filename>/</filename>
199 Will match the disks <filename>/usr</filename>
200 and <filename>/usr/local</filename>.
207 Will match the disks <filename>/usr</filename>
208 but not <filename>/usr/local</filename>.
215 Will match the disks <filename>\\windows1\share</filename> and <filename>\\windows2\share</filename>.
222 Will match the disks <filename>\\windows\share1</filename> and <filename>\\windows\share2</filename>.
227 <term>//windows/share</term>
229 Will match the disk <filename>\\windows\share</filename>.
239 <refsect1><title>DATESTAMP EXPRESSIONS</title>
241 <para>A datestamp expression is either a prefix of the datestamp, or a range
242 expression (separated by '-') matching several prefixes. A leading ^ is
243 removed, while arailing $ will force an exact match.</para>
245 <refsect2><title>Examples</title>
247 <variablelist remap="TP">
250 <term>20001212-14</term>
251 <listitem><para>match all dates beginning with 20001212, 20001213 or 20001214</para></listitem>
255 <term>20001212-4</term>
256 <listitem><para>same as previous</para></listitem>
260 <term>20001212-24</term>
261 <listitem><para>match all dates between 20001212 and 20001224</para></listitem>
266 <listitem><para>match all dates that start with 2000121 (20001210-20001219)</para></listitem>
271 <listitem><para>match all dates that start with 2 (20000101-29991231)</para></listitem>
276 <listitem><para>match all dates between 20000101-20101231</para></listitem>
281 <listitem><para>match only 200010</para></listitem>
290 <refsect1><title>LEVEL EXPRESSIONS</title>
292 <para>Level expressions are either prefix matches e.g., "1", which matches "1",
293 "10", and "123", absolute matches e.g., "3$" which only matches "3", or a
294 range e.g., "3-5" which only matches levels 3, 4, and 5.</para>
298 <refsect1><title>DUMP SPECIFICATIONS</title>
300 <para>A dump specification is used to select one or more dumps from the
301 catalog. It consists of a sequence of match expressions in the order host,
302 disk, datestamp, and level. Note that some commands do not take a level
303 argument, out of historical accident. Note, too, that the datestamp
304 expression matches the time that the dump was made on the Amanda client,
305 rather than the date it was moved to tape.</para>
307 <refsect2><title>Examples</title>
309 <variablelist remap='TP'>
311 <term>amtool MyConfig ^vpdesktop$</term>
312 <listitem><para>all dumps of host "vpdesktop"</para></listitem>
316 <term>amtool MyConfig '*' /var/stage</term>
317 <listitem><para>All dumps of <filename>/var/stage</filename> on any host</para></listitem>
321 <term>amtool MyConfig www1 /var/www '*' www2 /var/www '*'</term>
322 <listitem><para>All dumps of /var/www on www1 and www2 (assuming amtool does not
323 require a level argument)</para></listitem>
331 <refsect1><title>DLE SPECIFICATIONS</title>
333 <para>A DLE specification is used to select one or more DLEs. It consists of a
334 sequence of match expressions. The first must be a host, and subsequent
335 expressions will be experimentally matched against both hosts and disks in
336 the &disklist;, preferring hosts. This dynamic matching process can lead
337 to odd behavior in extreme cases (e.g., where a disk and a host have the
338 same name), but for most uses does exactly what is expected.</para>
340 <refsect2><title>Examples</title>
342 <variablelist remap='TP'>
344 <term>amtool MyConfig vpdesktop /home/anderson</term>
345 <listitem><para><filename>/home/anderson</filename> on host vpdesktop</para></listitem>
349 <term>amtool MyConfig '*' ^/etc '*' ^/var</term>
350 <listitem><para>All DLEs matching <filename>^/var</filename> or
351 <filename>^/etc</filename> on any host</para></listitem>
355 <term>amtool MyConfig web1 www web2 www</term>
356 <listitem><para>If no host matches "www", all DLEs matching
357 <filename>www</filename> on hosts web1 and web2. If a host
358 matches "www", then all DLEs on hosts www, web1, and web2.
368 <manref name="amanda" vol="8"/>,
369 <manref name="amfetchdump" vol="8"/>,
370 <manref name="amrestore" vol="8"/>,
371 <manref name="amadmin" vol="8"/>,
372 <manref name="amvault" vol="8"/>
373 <manref name="amflush" vol="8"/>
374 <manref name="amdump" vol="8"/>