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