source: trunk/athena/etc/track/subscriptionlist.5 @ 16559

Revision 16559, 7.8 KB checked in by ghudson, 23 years ago (diff)
Allow "! entry" in exception lists to track the file (overriding less specific wildcard entries which might indicate a different action). Prefer more specific wildcard entries, as measured by number of literal characters. Document that literal filenames and more specific wildcard entries are preferred in the exception list.
Line 
1.ll 6.5i
2.TH SUBSCRIPTIONLIST 5 "19 September 1988"
3.UC 4
4.SH NAME
5subscriptionlist \- describe files to be updated by track
6.SH DESCRIPTION
7.PP
8A
9.B subscriptionlist
10defines a set of files to be considered for updating by the
11.B track
12system.
13A
14.B subscriptionlist
15contains a set of
16.I entries.
17Typically, each
18.I entry
19represents a directory, but an
20.I entry
21may represent a file, link, or device.
22.P
23The librarian uses the command
24.sp 1
25.ti +4
26track -w [ options...]
27.I subscriptionlist
28.sp 1
29to prepare a
30.I statfile,
31which comprises an efficient representation of the
32library filesystem's currentness.
33.P
34The subscriber uses
35.B track
36& a subscriptionlist, together with the librarian's statfile,
37to update his own files from the library's copies.
38Note that the librarian & subscriber may use different subscriptionlists.
39.SH SYNTAX
40A subscriptionlist is a list of
41.I entries.
42.P
43A
44.I global exception-list
45may appear before the first
46.I entry.
47This takes the form:
48.sp 1
49.br
50GLOBAL :
51.I pattern ...
52:
53.sp 1
54.br
55where each
56.I pattern
57is a shell-wildcard, using '*', '?', and '[]'.
58Braces '{}' are not interpreted in subscriptionlist patterns.
59.PP
60Each
61.I entry
62has 5 fields, separated by colons:
63.sp 1
64.I fromfile
65:
66.I tofile
67:
68.I cmpfile
69:
70.I except-list
71: [ command...]
72.sp 1
73The fields are (in order) :
74.RS
75.ti -2
761)
77.I fromfile:
78name of the source file on the librarian machine.
79This field must not be blank.
80.ti -2
812)
82.I tofile:
83name of the destination file on the subscriber machine.
84Default is
85.I fromfile.
86.ti -2
873)
88.I cmpfile:
89name of the comparison file on the subscriber machine,
90to be used for determining if an update is necessary.
91Default is
92.I tofile.
93.ti -2
944)
95.I exception-list:
96a list of special cases and files to be excluded from updating.
97.ti -2
985) A shell
99.I command-line
100to be executed whenever an update is made.
101(NOTE: this feature is currently disabled, because it needs to be rewritten.)
102.RE
103.P
104Fields are separated by a colon.
105The last field (and thus the entry) is terminated with a newline.
106.sp 1
107Each of the fields
108.I fromfile, tofile, cmpfile,
109is stripped of leading slashes '/',
110and leading/trailing white space is ignored in these fields.
111.sp 1
112In the
113.I exception-list,
114whitespace is used to separate entries.
115.sp 1
116In the
117.I command-line,
118all white space is preserved and passed to /bin/sh, and
119newlines can be escaped with a backslash.
120The backslash will be removed before the script is sent to the shell.
121.sp 1
122Any characters after a hashmark, "#", up to the end of line
123will be treated as comments and ignored.
124.SH SEMANTICS
125.P
126In the following, we assume that
127.B track
128has been invoked with the command-line options "-F/from_mnt -T/to_mnt",
129and that the librarian file-system has been
130mounted on the mount-point /from_mnt.
131For each entry "A ::: a b c :",
132.B track
133compares the trees /from_mnt/A & /to_mnt/A,
134and then updates /to_mnt/A and its subordinates if necessary,
135excepting the subtrees a, b, & c.
136Note that the librarian's exception-list for A is also in effect, because
137.B track
138's knowledge of /from_mnt's file-system state comes from the librarian's
139.I statfile
140(q.v.).
141.P
142.B Track
143does not require the pathnames indicated by
144.I fromfile, tofile, & cmpfile
145to have the same file-type.
146If, however, non-default directories
147.I tofile
148or
149.I cmpfile
150appear in the entry, track will expect these trees to parallel
151.I fromfile's
152structure quite perfectly.
153If an entry specifies
154.I cmpfile
155explicitly, cmpfile will be path-qualified with either /from_mnt or /to_mnt,
156according to whether or not the -w option is used.
157.P
158If the name of a directory is used in any field,
159.B track
160treats the directory as being the root of a subtree.
161If the name of a symbolic link is used in any field,
162.B track
163will handle the symbolic link itself and will NOT follow the link.
164.PP
165If, in an
166.I exception-list,
167an item A is preceded by an arrow "->",
168.B track
169will export/import a symbolic-link
170to the librarian's copy of the named item.  If an item is preceded by an
171explanation point "!",
172.B track
173will export/import the file normally, as if it did not appear in the
174exception list.  Wild-card patterns may appear in the exception-lists.
175Literal filenames always supercede wild-card patterns in the
176exception-list; for example, an entry "! filename" would take
177precedence over an entry "-> *".  Wild-card patterns with more literal
178characters supercede wild-card patterns with fewer literal characters;
179for example, an entry "-> a*b" would take precedence over an entry
180"*".
181.RE
182.P
183Because this is a data-description-language, and not a procedural language,
184the order of the
185.I entries'
186appearance in the subscriptionlist is not important.
187.B Track
188traverses the subscriptionlist more-or-less alphabetically,
189but it is unwise to assume that
190.B track
191will update one entry before another.
192If one
193.I entry
194is a subdirectory of another,
195.B track
196ensures that the parent directory
197is updated first, but that the child-entry's exception-list will be applied
198to the the child-directory's contents.
199.SH EXAMPLES
200.in 8
201
202.ti -8
203etc/hosts : : : :
204.br
205This entry specifies the file named "/mnt/etc/hosts".
206.sp  1
207.ti -8
208/etc/hosts : : : :
209.ti -8
210/etc/services : : : :
211.br
212These entries specify the files "/mnt/etc/hosts" and "/mnt/etc/services".
213.sp  1
214.ti -8
215usr/lib : : : :
216.br
217This entry specifies the entire subtree rooted at /mnt/usr/lib
218.sp 1
219.ti -8
220/usr/lib : : : sendmail.cf uucp :
221.br
222This entry specifies files in the subtree rooted
223at "/mnt/usr/lib" except for "/mnt/usr/lib/sendmail.cf" and all files
224in the subtree rooted at "/mnt/usr/lib/uucp".
225.ti -8
226/usr/lib/aliases : : : : newaliases
227.br
228This entry specifies the file "/mnt/usr/lib/aliases" and
229will execute the command "newaliases" if and only if
230a new version is successfully copied.
231.sp 1
232.ti -8
233/usr/lib/aliases : : : : newaliases \e
234.ti -4
235echo aliases file has been updated \(bv mail root
236.br
237This entry works exactly like the previous example and
238in addition sends mail to the administrator.
239.sp 1
240.ti -8
241/usr/lib/aliases : : : : newaliases \e
242.ti -4
243echo `date` /usr/lib/aliases >> /usr/adm/tracklog
244.br
245This entry works exactly like the previous example except that rather than
246sending mail, a log entry containing the date and filename is appended to the
247file named "/usr/adm/tracklog".
248.sp 1
249.ti -8
250/usr/lib/aliases : /tmp/aliases : : : \e
251.ti -4
252echo new aliases file has arrived \(bv mail root
253.br
254This entry copies any new versions of the file named "/usr/lib/aliases" on the
255.I librarian
256to a locally named file "/tmp/aliases" and sends mail to the administrator.
257.sp 1
258.ti -8
259/etc/zoneinfo::: ->* Australia GMT*:
260.ti -8
261/etc/zoneinfo/EST::::
262.ti -8
263/etc/zoneinfo/EST5EDT::::
264.ti -8
265/etc/zoneinfo/localtime::::
266.br
267These entries cause a "link-farm" to be maintained under /etc/zoneinfo,
268except that EST, EST5EDT, and localtime will be updated normally,
269and Australia, GMT, GMT+1, GMT+2, etc., will be ignored.
270.sp 1
271.ti -8
272/bin/sh : /bin/nsh : : : \e
273.ti -4
274mv /bin/sh /bin/osh \e
275.ti -4
276mv /bin/nsh /bin/sh \e
277.ti -4
278echo new shell installed \(bv  mail root
279.br
280This entry copies any new versions of the file named "/bin/sh" on the
281.I librarian
282to a locally named file "/bin/nsh", then saves "/bin/sh" in "/bin/osh",
283then moves the the new version into "/bin/sh".
284.sp 1
285.ti -8
286/usr/sys/GORP/vmunix : /nvmunix : /vmunix : : \e
287.ti -4
288mv /vmunix /ovmunix \e
289.ti -4
290mv /nvmunix /vmunix \e
291.ti -4
292shutdown -r now
293.br
294This entry causes
295.B track
296to compare the locally named file "/vmunix" with the
297.I librarian's
298file named
299"/usr/sys/GORP/vmunix".
300If the versions differ, the new version will be copied into
301the locally named file "/nvmunix" and the shell script will
302be executed to install and reboot with the new kernel.
303.in -8
304.SH FILES
305 .../track/slists/
306.I subscriptionlist_name
307.SH BUGS
308.SH "SEE ALSO"
309track(1)
310.br
311statfile(5)
312.br
313When Network File Systems Aren't Enough: Automatic File Distribution Revisited
314.br
315.ti 5
316by Daniel Nachbar
Note: See TracBrowser for help on using the repository browser.