1AMANDA-MATCH(7)                   Miscellanea                  AMANDA-MATCH(7)
2
3
4

NAME

6       amanda-match - Common Amanda Match Expression
7

DESCRIPTION

9       Several Amanda commands allow the user to specify dumps using "match
10       expressions". This manual page describes the syntax of these
11       expressions.
12
13       In some places, only certain match expressions are allowed. However,
14       several commands take a dump specification ("dumpspec") consisting of a
15       sequence of several expressions intended to match particular dumps in
16       the catalog. Other applications take a DLE specification which
17       indicates a set of DLEs to be operated on. These formats are described
18       below.
19
20       An expression can be disabled be preceding it with the '=' character,
21       in that case, an exact match is used.
22
23       Many program have an '--exact-match' argument that disable expression
24       and exact match are used.
25

HOST & DISK EXPRESSIONS

27       The hosts and disks match by word. Each word is a glob expression, and
28       words are separated by the character '.' for host expressions and '/'
29       for disk expressions. You can anchor the expression on the left with a
30       '^' or on the right with a '$'. The matcher is case insensitive for
31       hosts but case sensitive for disks. A match succeeds if all words in
32       the expression match contiguous words in the host or disk.
33
34       If the disk is a UNC ("\\windows\share") then all '\' are converted to
35       '/' before the match. Using '\' is complicated because of the extra
36       quoting required by the shell and amanda. It's easier to use '/'
37       because it requires less quoting ("//windows/share")
38
39       The special characters follow. Note that the shell interprets some of
40       these characters, so when used on the command line, they must be
41       escaped appropriately for the shell.
42
43       dot (.)
44           word separator for a host
45
46       /
47           word separator for a disk
48
49       \
50           word separator for a UNC disk
51
52       ^
53           anchor at left of word
54
55       $
56           anchor at right of word
57
58       ?
59           match exactly one character except the separator
60
61       *
62           match zero or more characters except the separator
63
64       **
65           match zero or more characters including the separator
66
67       [...]
68           match exactly one of the characters enclosed by the brackets.
69
70       [!...]
71           match exactly one character that is not enclosed by the brackets.
72
73   Examples
74       hosta
75           Will match hosta, foo.hosta.org, and hoSTA.dOMAIna.ORG but not
76           hostb.
77
78       host
79           Will match host but not hosta.
80
81       host?
82           Will match hosta and hostb, but not host or hostabc.
83
84       ho*na
85           Will match hoina but not ho.aina.org.
86
87       ho**na
88           Will match hoina and ho.aina.org.
89
90       ^hosta
91           Will match hosta but not foo.hosta.org.
92
93       sda*
94           Will match /dev/sda1 and /dev/sda12.
95
96       /opt
97           Will match the disk opt but not the host opt.
98
99       (note dots:) .opt.
100           Will match the host opt but not the disk opt.
101
102       /
103           Will match the disk / but no other disk.
104
105       /usr
106           Will match the disks /usr and /usr/local.
107
108       /usr$
109           Will match the disks /usr but not /usr/local.
110
111       share
112           Will match the disks \\windows1\share and \\windows2\share.
113
114       share*
115           Will match the disks \\windows\share1 and \\windows\share2.
116
117       //windows/share
118           Will match the disk \\windows\share.
119

DATESTAMP EXPRESSIONS

121       A datestamp expression is either a prefix of the datestamp, or a range
122       expression (separated by '-') matching several prefixes. A leading ^ is
123       removed, while arailing $ will force an exact match.
124
125   Examples
126       20001212-14
127           match all dates beginning with 20001212, 20001213 or 20001214
128
129       20001212-4
130           same as previous
131
132       20001212-24
133           match all dates between 20001212 and 20001224
134
135       2000121
136           match all dates that start with 2000121 (20001210-20001219)
137
138       2
139           match all dates that start with 2 (20000101-29991231)
140
141       2000-10
142           match all dates between 20000101-20101231
143
144       200010$
145           match only 200010
146

LEVEL EXPRESSIONS

148       Level expressions are either prefix matches e.g., "1", which matches
149       "1", "10", and "123", absolute matches e.g., "3$" which only matches
150       "3", or a range e.g., "3-5" which only matches levels 3, 4, and 5.
151

DUMP SPECIFICATIONS

153       A dump specification is used to select one or more dumps from the
154       catalog. It consists of a sequence of match expressions in the order
155       host, disk, datestamp, and level. Note that some commands do not take a
156       level argument, out of historical accident. Note, too, that the
157       datestamp expression matches the time that the dump was made on the
158       Amanda client, rather than the date it was moved to tape.
159
160   Examples
161       amtool MyConfig ^vpdesktop$
162           all dumps of host "vpdesktop"
163
164       amtool MyConfig '*' /var/stage
165           All dumps of /var/stage on any host
166
167       amtool MyConfig www1 /var/www '*' www2 /var/www '*'
168           All dumps of /var/www on www1 and www2 (assuming amtool does not
169           require a level argument)
170

DLE SPECIFICATIONS

172       A DLE specification is used to select one or more DLEs. It consists of
173       a sequence of match expressions. The first must be a host, and
174       subsequent expressions will be experimentally matched against both
175       hosts and disks in the disklist(5), preferring hosts. This dynamic
176       matching process can lead to odd behavior in extreme cases (e.g., where
177       a disk and a host have the same name), but for most uses does exactly
178       what is expected.
179
180   Examples
181       amtool MyConfig vpdesktop /home/anderson
182           /home/anderson on host vpdesktop
183
184       amtool MyConfig '*' ^/etc '*' ^/var
185           All DLEs matching ^/var or ^/etc on any host
186
187       amtool MyConfig web1 www web2 www
188           If no host matches "www", all DLEs matching www on hosts web1 and
189           web2. If a host matches "www", then all DLEs on hosts www, web1,
190           and web2.
191

SEE ALSO

193       amanda(8), amanda(8), amfetchdump(8), amrestore(8), amadmin(8),
194       amvault(8), amflush(8), amdump(8)
195
196       The Amanda Wiki: : http://wiki.zmanda.com/
197

AUTHOR

199       Dustin J. Mitchell <dustin@zmanda.com>
200           Zmanda, Inc. (http://www.zmanda.com)
201
202
203
204Amanda 3.3.3                      01/10/2013                   AMANDA-MATCH(7)
Impressum