chiark / gitweb /
configure.ac: Don't let the LIBS setting leak out.
[distorted-backup] / snaptab.5.in
CommitLineData
99248ed2
MW
1.ie t .ds o \(bu
2.el .ds o o
3.de hP
4.IP
5\h'-\w'\fB\\$1\ \fP'u'\fB\\$1\ \fP\c
6..
7.TH snaptab 5 "6 November 2011" "distorted.org.uk backup"
8.SH NAME
9snaptab \- device-level snapshot parameters
10.SH DESCRIPTION
11The
12.B snaptab
13file describes mechanisms and parameters for taking snapshots of block
14devices. The
15.BR snap (8)
16program by default reads
17.BR @sysconfdir@/snaptab ,
18but it can be instructed to read a different file using the
19.B \-c
20command-line option.
21.SS Syntax
22The file consists of a sequence of logical lines. A logical line
23consists of one or more newline-terminated physical lines, all but the
24last of which ends with a backslash
25.B ` \e '
26followed by zero or more whitespace characters. These trailing
27backslashes and trailing whitespace are stripped from the logical line
28during parsing, and are not further significant.
29.PP
30A logical line may be
31.IR empty ,
32consisting only of whitespace;
33a
34.IR comment ,
35beginning with zero or more whitespace characters followed by a
36.RB ` # ';
37or a
38.IR "data line" .
39Empty lines and comments are ignored.
40.PP
41A data line consists of two or more whitespace-separated fields. There
42may be leading or trailing whitespace; this is not significant.
43Whitespace characters may be included in a field using escaping or
44quoting, in a manner similar to the Bourne shell, though it is not
45possible for a field to contain a newline character.
46.PP
47The precise quoting and escaping rules are as follows. All characters
48other than whitespace (i.e., space, horizontal and vertical tabs, and
49formfeed), the backslash
50.RB ` \e ',
51the single-quote
52.RB ` ' ',
53and the double-quote
54.RB ` """" ',
55are
56.I ordinary
57and have no special meaning. A character preceded by an unescaped
58backslash is
59.IR escaped ;
60any other character is
61.I unescaped .
62If an unquoted, unescaped double- or single-quote character occurs, the
63following characters, up until but not including the next unescaped
64occurrence of the same quote character, are
65.I double-
66or
67.I single-quoted
68respectively; other characters are
69.IR unquoted .
70A character is
71.I constituent
72if it is ordinary, escaped, single-quoted, or both double-quoted and not
73a backslash. A field's text consists of all of the constituent
74characters bounded by the start of the line, the end of the line, or
75sequences of one or more unescaped, unquoted whitespace characters.
76.PP
77The fields of a data line are as follows.
78.IP
79.I "device type option \fR..."
80Briefly, the fields are interpreted as follows. A full description is
81given below.
82.TP
83.I device
84The name of a device which can be snapshot. This is usually the name of
85a device node in
86.B /dev
87without the
88.RB ` /dev '
89prefix, though strictly speaking its interpretation is left up to the
90snapshot handler program. Alternatively, this can be the special name
91.RB ` * '
92to define default options for a particular snapshot type.
93.TP
94.I type
95The type of snapshot to be performed. For each snapshot type, there is
96a program
97.BI snap. type
98which manages snapshots of that type.
99.TP
100.IB option
101The remaining fields are option assignments: these are either individual
102.IB key = value
103assignments, or tokens of the form
104.B *. type
105to interpolate the current default options for the given
106.IR type .
107.SS Interpretation
108The configuration file's data lines describe a mapping from
109.I device
110names to
111.IR type s
112and sequences of
113.IR options .
114This section describes how the mapping is derived from the file
115contents.
116.PP
117Abstractly,
118.IR device s
119and
120.IR type s
121are arbitrary strings, and
122.IR option s
123are strings of the form
124.IB key = value \fR,
125where the
126.I key
127is a nonempty string which contains no
128.RB ` = '
129characters, and the
130.I value
131is an arbitrary string. An option of the form
132.IB key . type = value
133is said to be
134.IR qualified ;
135otherwise, an option is
136.IR unqualified .
137In a qualified option, the
138.I type
139may not contain a
140.RB ` . '
141character.
142.PP
143A data line's
144.I option
145sequence may contain
146.IB key = value
147assignments, which are not further interpreted, and various special
148tokens. These tokens are replaced with other options or sequences of
149options during
150.IR expansion .
151The following tokens are recognized during expansion, and replaced.
152.TP
153.BI *. type
154The replacement sequence is constructed as follows. Start with the
155default option sequence for the
156.I type
157for this line (see below). Each qualified option in this sequence is
158retained; each unqualified option
159.IB key = value
160is qualified by
161.I type
162yielding
163.IB key . type = value \fR.
164.PP
165The
166.I "default option sequence"
167for a particular
168.I type
169.I t
170at a given line in the file is the concatenation of the expanded option
171sequences of all earlier data lines whose
172.I device
173field is
174.B *
175and whose
176.I type
177is
178.IR t .
179.PP
180The option sequence of a data line whose
181.I device
182is not
183.B *
184is
185.I augmented
186by prefixing the expanded option sequence with the default option
187sequence for the corresponding
188.I type
189 at that line.
190.PP
191It is an error if two data lines with equal
192.I device
193fields have different
194.I type
195fields, unless the
196.I device
197is
198.BR * .
199.PP
200The mapping from
201.I device
202names to
203.IR type s
204and
205.I option
206sequences can now be defined. Collect all of the data lines whose
207.I device
208field matches the input
209.I device
210name. The common
211.I type
212field from these lines is the resulting
213.IR type ;
214The resulting option sequence is the concatenation of the augmented
215option sequences for the collected lines.
216.PP
217Note that the
218.BR snap (8)
219program filters the option sequence, retaining only the last option with
220an given
221.IR key .
222.SH EXAMPLE
223Consider the file below.
224.IP
225.nf
226.ft B
227.ta 8 16 24 32 40 48 56 64
228## Set defaults.
229* lvm \e
230 snapsz=5%ORIGIN
231
232* rfreezefs \e
233 subtype=lvm \e
234 *.lvm
235
236## Local filesystems.
237md/boot ro dir=/boot
238vg-ibanez/root lvm
239vg-ibanez/home lvm
240vg-ibanez/scratch lvm
241vg-ibanez/usr lvm
242vg-ibanez/var lvm
243
244## Remotely mounted filesystems.
245* rfreezefs host=roadstar
246vg-ibanez/db rfreezefs dir=/mnt/db
247vg-ibanez/ftp rfreezefs dir=/mnt/ftp
248vg-ibanez/news rfreezefs dir=/var/spool/news
249
250* rfreezefs host=jem
251vg-ibanez/homes rfreezefs dir=/home
252vg-ibanez/jb rfreezefs dir=/mnt/jb
253.fi
254.ft P
255.PP
256Now:
257.hP \*o
258At the
259.B md/boot
260line, the default option list for type
261.B lvm
262is
263.B snapsz=5%ORIGIN
264and the default option list for type
265.B rfreezefs
266is
267.B subtype=lvm
268.BR snapsz.lvm=5%ORIGIN .
269.hP \*o
270The device
271.B vg-ibanez/scratch
272has type
273.B lvm
274and option list
275.BR snapsz=5%ORIGIN .
276.hP \*o
277The device
278.B vg-ibanez/db
279maps to type
280.B rfreezefs
281and option list
282.B subtype=lvm
283.B snapsz.lvm=5%ORIGIN
284.B host=roadstar
285.BR dir=/mnt/db .
286.hP \*o
287The device
288.B vg-ibanez/jb
289maps to type
290.B rfreezefs
291and option list
292.B subtype=lvm
293.B snapsz.lvm=5%ORIGIN
294.B host=roadstar
295.B host=jem
296.BR dir=/mnt/db ;
297but only the latter
298.B host
299option is significant \(en the other will be omitted from the list
300passed to
301.BR snap.rfreezefs (8).
302.SH SEE ALSO
303.BR snap (8)
304.SH AUTHOR
305Mark Wooding, <mdw@distorted.org.uk>