Print this page
6198 Let's EOL cachefs
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/man/man1/filesync.1.man.txt
+++ new/usr/src/man/man1/filesync.1.man.txt
1 1 FILESYNC(1) User Commands FILESYNC(1)
2 2
3 3
4 4
5 5 NAME
6 6 filesync - synchronize ordinary, directory or special files
7 7
8 8 SYNOPSIS
9 9 filesync [-aehmnqvy] [-o src | dst]
10 10 [-f src | dst | old | new] [-r directory]...
11 11
12 12
13 13 filesync [-aehmnqvy] -s source-dir -d dest-dir filename...
14 14
15 15
16 16 DESCRIPTION
17 17 The filesync utility synchronizes files between multiple computer
18 18 systems, typically a server and a portable computer. filesync
19 19 synchronizes ordinary, directory or special files. Although intended
20 20 for use on nomadic systems, filesync is useful for backup and file
21 21 replication on more permanently connected systems.
22 22
23 23
24 24 If files are synchronized between systems, the corresponding files on
25 25 each of the systems are identical. Changing a file on one or both of
↓ open down ↓ |
25 lines elided |
↑ open up ↑ |
26 26 the systems causes the files to become different (not synchronized). In
27 27 order to make the files identical again, the differences between the
28 28 files must be reconciled. See Reconciling and Synchronizing Files for
29 29 specific details about how filesync reconciles and synchronizes files.
30 30
31 31
32 32 There are two forms of the filesync command. The first form of filesync
33 33 is invoked without file arguments. This form of filesync reconciles
34 34 differences between the files and systems specified in the
35 35 $HOME/.packingrules file. $HOME/.packingrules is a packing rules list
36 - for filesync and cachefspack, and contains a list of files to be kept
37 - synchronized. See packingrules(4) and cachefspack(1M).
36 + for filesync and contains a list of files to be kept synchronized. See
37 + packingrules(4).
38 38
39 39
40 40 The second form of filesync copies specific files from a directory on
41 41 the source system to a directory on the destination system. In
42 42 addition, this form of filesync adds the file or files specified as
43 43 arguments (filename) to $HOME/.packingrules. See -s and -d for
44 44 information about specifying directories on source and destination
45 45 systems. See OPERANDS for details about specifying file (filename)
46 46 arguments.
47 47
48 48
49 49 Multiple filesync commands are cumulative (that is, the specified files
50 50 are added to the already existing packing rules file list). See
51 51 Multiple filesync Commands.
52 52
53 53 Reconciling and Synchronizing Files
54 54 filesync synchronizes files between computer systems by performing the
55 55 following two tasks:
56 56
57 57 1. filesync examines the directories and files specified in the
58 58 packing rules file on both systems, and determines whether
59 59 or not they are identical. Any file that differs requires
60 60 reconciliation.
61 61
62 62 filesync also maintains a baseline summary in the
63 63 $HOME/.filesync-base file for all of the files that are being
64 64 monitored. This file lists the names, types, and sizes of
65 65 all files as of the last reconciliation.
66 66
67 67 2. Based on the information contained in the baseline file and
68 68 the specified options (see Resolving filesync Conflicts),
69 69 filesync determines which of the various copies is the
70 70 correct one, and makes the corresponding changes to the
71 71 other system. Once this has been done, the two copies are,
72 72 again, identical (synchronized).
73 73
74 74 If a source file has changed and the destination file has
75 75 not, the changes on the source system are propagated to the
76 76 destination system. If a destination file has changed and
77 77 the corresponding source file has not, the changes on the
78 78 destination file are propagated to the source system. If
79 79 both systems have changed (and the files are not still
80 80 identical) a warning message will be printed out, asking the
81 81 user to resolve the conflict manually. See Resolving
82 82 filesync Conflicts.
83 83
84 84 Resolving filesync Conflicts
85 85 In cases where files on both sides have changed, filesync attempts to
86 86 determine which version should be chosen. If filesync cannot
87 87 automatically determine which version should be selected, it prints out
88 88 a warning message and leaves the two incompatible versions of the file
89 89 unreconciled.
90 90
91 91
92 92 In these cases, you must either resolve the differences manually, or
93 93 tell filesync how to choose which file should win. Use the -o and -f
94 94 options to tell filesync how to resolve conflicts (see OPTIONS).
95 95
96 96
97 97 Alternatively, for each conflicting file, you can examine the two
98 98 versions, determine which one should be kept, and manually bring the
99 99 two versions into agreement (by copying, deleting, or changing the
100 100 ownership or protection to be correct). You can then re-run filesync to
101 101 see whether or not any other conflicts remain.
102 102
103 103 Packing Rules File
104 104 The packing rules file $HOME/.packingrules contains a list of files to
105 105 be kept synchronized. The syntax of this file is described in
106 106 packingrules(4).
107 107
108 108
109 109 The $HOME/.packingrules file is automatically created if users invoke
110 110 filesync with filename arguments. By using filesync options, users can
111 111 augment the packing rules in $HOME/.packingrules.
112 112
113 113
114 114 Many users choose to create the packing rules file manually and edit it
115 115 by hand. Users can edit $HOME/.packingrules (using any editor) to
116 116 permanently change the $HOME/.packingrules file, or to gain access to
117 117 more powerful options that are not available from the command line
118 118 (such as IGNORE commands). It is much easier to enter complex wildcard
119 119 expressions by editing the $HOME/.packingrules file.
120 120
121 121 Baseline File
122 122 $HOME/.filesync-base is the filesync baseline summary file. filesync
123 123 uses the information in $HOME/.filesync-base to identify the differences
124 124 between files during the reconciliation and synchronization process.
125 125 Users do not create or edit the baseline file. It is created
126 126 automatically by filesync and records the last known state of
127 127 agreement between all of the files being maintained.
128 128
129 129 Multiple filesync Commands
130 130 Over a period of time, the set of files you want to keep synchronized
131 131 can change. It is common, for instance, to want to keep files
132 132 pertaining to only a few active projects on your notebook. If you
133 133 continue to keep files associated with every project you have ever
134 134 worked on synchronized, your notebook's disk will fill up with old
135 135 files. Each filesync command will waste a lot of time updating files
136 136 you no longer care about.
137 137
138 138
139 139 If you delete the files from your notebook, filesync will want to
140 140 perform the corresponding deletes on the server, which would not be
141 141 what you wanted. Rather, you would like a way to tell filesync to stop
142 142 synchronizing some of the files. There are two ways to do this:
143 143
144 144 1. Edit $HOME/.packingrules. Delete the rules for the files
145 145 that you want to delete.
146 146
147 147 2. Delete $HOME/.packingrules. Use the filesync command to
148 148 specify the files that you want synchronized.
149 149
150 150
151 151 Either way works, and you can choose the one that seems easiest to you.
152 152 For minor changes, it is probably easier to just edit
153 153 $HOME/.packingrules. For major changes it is probably easier to start
154 154 from scratch.
155 155
156 156
157 157 Once filesync is no longer synchronizing a set of files, you can
158 158 delete them from your notebook without having any effect on the server.
159 159
160 160 Nomadic Machines
161 161 When using filesync to keep files synchronized between nomadic machines
162 162 and a server, store the packing rules and baseline files on the nomadic
163 163 machines, not the server. If, when logged into your notebook, the HOME
164 164 environment variable does not normally point to a directory on your
165 165 notebook, you can use the FILESYNC environment variable to specify an
166 166 alternate location for the packing rules and baseline files.
167 167
168 168
169 169 Each nomadic machine should carry its own packing rules and baseline
170 170 file. Incorrect file synchronization can result if a server carries a
171 171 baseline file and multiple nomadic machines attempt to reconcile
172 172 against the server's baseline file. In this case, a nomadic machine
173 173 could be using a baseline file that does not accurately describe the
174 174 state of its files. This might result in incorrect reconciliations.
175 175
176 176
177 177 To safeguard against the dangers associated with a single baseline
178 178 file being shared by more than two machines, filesync adds a default
179 179 rule to each new packing rules file. This default rule prevents the
180 180 packing rules and baseline files from being copied.
181 181
182 182 OPTIONS
183 183 The following options are supported:
184 184
185 185 -a
186 186 Force the checking of Access Control Lists
187 187 (ACLs ) and attempt to make them agree for
188 188 all new and changed files. If it is not
189 189 possible to set the ACL for a particular
190 190 file, filesync stops ACL synchronization
191 191 for that file.
192 192
193 193 Some file systems do not support ACLs . It
194 194 is not possible to synchronize ACLs between
195 195 file systems that support ACLs and those
196 196 that do not; attempting to do so will
197 197 result in numerous error messages.
198 198
199 199
200 200 -d dest-dir
201 201 Specify the directory on the destination
202 202 system into which filename is to be copied.
203 203 Use with the -s source-dir option and the
204 204 filename operand. See -s and OPERANDS.
205 205
206 206
207 207 -e
208 208 Flag all differences. It may not be
209 209 possible to resolve all conflicts involving
210 210 modes and ownership (unless filesync is
211 211 being run with root privileges). If you
212 212 cannot change the ownership or protections
213 213 on a file, filesync will normally ignore
214 214 conflicts in ownership and protection. If
215 215 you specify the -e (everything must agree)
216 216 flag, however, filesync will flag these
217 217 differences.
218 218
219 219
220 220 -f src | dst | old | new
221 221 The -f option tells filesync how to resolve
222 222 conflicting changes. If a file has been
223 223 changed on both systems, and an -f option
224 224 has been specified, filesync will retain
225 225 the changes made on the favored system and
226 226 discard the changes made on the unfavored
227 227 system.
228 228
229 229 Specify -f src to favor the source-system
230 230 file. Specify -f dst to favor the
231 231 destination-system file. Specify -f old to
232 232 favor the older version of the file.
233 233 Specify -f new to favor the newer version of
234 234 the file.
235 235
236 236 It is possible to specify the -f and -o
237 237 options in combination if they both specify
238 238 the same preference (src and dst). If -f
239 239 and -o conflict, the -f option is ignored.
240 240 See the -o option description.
241 241
242 242
243 243 -h
244 244 Halt on error. Normally, if filesync
245 245 encounters a read or write error while
246 246 copying files, it notes the error and the
247 247 program continues, in an attempt to
248 248 reconcile other files. If the -h option is
249 249 specified, filesync will immediately halt
250 250 when one of these errors occurs and will
251 251 not try to process any more files.
252 252
253 253
254 254 -m
255 255 Ensure that both copies of the file have
256 256 the same modification time. The
257 257 modification time for newly copied files is
258 258 set to the time of reconciliation by
259 259 default. File changes are ordered by
260 260 increasing modification times so that the
261 261 propagated files have the same relative
262 262 modification time ordering as the original
263 263 changes. Users should be warned that there
264 264 is usually some time skew between any two
265 265 systems, and transferring modification
266 266 times from one system to another can
267 267 occasionally produce strange results.
268 268
269 269 There are instances in which using filesync
270 270 to update some (but not all) files in a
271 271 directory will confuse the make program.
272 272 If, for instance, filesync is keeping .c
273 273 files synchronized, but ignoring .o files,
274 274 a changed .c file may show up with a
275 275 modification time prior to a .o file that
276 276 was built from a prior version of the .c
277 277 file.
278 278
279 279
280 280 -n
281 281 Do not really make the changes. If the -n
282 282 option is specified, filesync determines
283 283 what changes have been made to files, and
284 284 what reconciliations are required and
285 285 displays this information on the standard
286 286 output. No changes are made to files,
287 287 including the packing rules file.
288 288
289 289 Specifying both the -n and -o options causes
290 290 filesync to analyze the prevailing system
291 291 and report the changes that have been made
292 292 on that system. Using -n and -o in
293 293 combination is useful if your machine is
294 294 disconnected (and you cannot access the
295 295 server) but you want to know what changes
296 296 have been made on the local machine. See
297 297 the -o option description.
298 298
299 299
300 300 -o src | dst
301 301 The -o option forces a one-way
302 302 reconciliation, favoring either the source
303 303 system (src) or destination system (dst).
304 304
305 305 Specify -o src to propagate changes only
306 306 from the source system to the destination
307 307 system. Changes made on the destination
308 308 system are ignored. filesync aborts if it
309 309 cannot access a source or destination
310 310 directory.
311 311
312 312 Specify -o dst to propagate changes only
313 313 from the destination system to the source
314 314 system. Changes made on the source system
315 315 are ignored. filesync aborts if it cannot
316 316 access a source or destination directory.
317 317
318 318 Specifying -n with the -o option causes
319 319 filesync to analyze the prevailing system
320 320 and reports on what changes have been made
321 321 on that system. Using -n and -o in
322 322 combination is useful if a machine is
323 323 disconnected (and there is no access to the
324 324 server), but you want to know what changes
325 325 have been made on the local machine. See
326 326 the -n option description.
327 327
328 328 It is possible to specify the -o and -f
329 329 options in combination if they both specify
330 330 the same preference (src or dst). If -o and
331 331 -f options conflict, the -f option will be
332 332 ignored. See the -f option description.
333 333
334 334
335 335 -q
336 336 Suppress the standard filesync messages
337 337 that describe each reconciliation action as
338 338 it is performed.
339 339
340 340 The standard filesync message describes
341 341 each reconciliation action in the form of a
342 342 UNIX shell command (for example, mv, ln,
343 343 cp, rm, chmod, chown, chgrp, setfacl, and
344 344 so forth).
345 345
346 346
347 347 -r directory
348 348 Limit the reconciliation to directory.
349 349 Specify multiple directories with multiple
350 350 -r specifications.
351 351
352 352
353 353 -s source-dir
354 354 Specify the directory on the source system
355 355 from which the filename to be copied is
356 356 located. Use with the -d dest-dir option and
357 357 the filename operand. See the -d option
358 358 description and OPERANDS.
359 359
360 360
361 361 -v
362 362 Display additional information about each
363 363 file comparison as it is made on the
364 364 standard output.
365 365
366 366
367 367 -y
368 368 Bypass safety check prompts. Nomadic
369 369 machines occasionally move between domains,
370 370 and many of the files on which filesync
371 371 operates are expected to be accessed by
372 372 NFS. There is a danger that someday
373 373 filesync will be asked to reconcile local
374 374 changes against the wrong file system or
375 375 server. This could result in a large number
376 376 of inappropriate copies and deletions. To
377 377 prevent such a mishap, filesync performs a
378 378 few safety checks prior to reconciliation.
379 379 If large numbers of files are likely to be
380 380 deleted, or if high level directories have
381 381 changed their I-node numbers, filesync
382 382 prompts for a confirmation before
383 383 reconciliation. If you know that this is
384 384 likely, and do not want to be prompted, use
385 385 the -y (yes) option to automatically confirm
386 386 these prompts.
387 387
388 388
389 389 OPERANDS
390 390 The following operands are supported:
391 391
392 392 filename
393 393 The name of the ordinary file, directory, symbolic link, or
394 394 special file in the specified source directory (source-dir)
395 395 to be synchronized. Specify multiple files by separating
396 396 each filename by spaces. Use the filename operand with the
397 397 -s and -d options. See OPTIONS.
398 398
399 399 If filename is an ordinary file, that ordinary file will be
400 400 replicated (with the same filename) in the specified
401 401 destination directory (dest-dir).
402 402
403 403 If filename is a directory, that directory and all of the
404 404 files and subdirectories under it will be replicated
405 405 (recursively) in the specified destination directory (dest-
406 406 dir).
407 407
408 408 If filename is a symbolic link, a copy of that symbolic
409 409 link will be replicated in the specified destination
410 410 directory (dest-dir).
411 411
412 412 If filename is a special file, a special file with the same
413 413 major or minor device numbers will be replicated in the
414 414 specified destination directory. (dest-dir). Only super-
415 415 users can use filesync to create special files.
416 416
417 417 Files created in the destination directory (dest-dir) will
418 418 have the same owner, group and other permissions as the
419 419 files in the source directory.
420 420
421 421 If filename contains escaped shell wildcard characters, the
422 422 wildcard characters are stored in $HOME/.packingrules and
423 423 evaluated each time filesync is run.
424 424
425 425 For example, the following would make sure that the two
426 426 specified files, currently in $RHOME, were replicated in
427 427 $HOME:
428 428
429 429 filesync -s $RHOME -d $HOME a.c b.c
430 430
431 431
432 432 The following example would ensure that all of the *.c
433 433 files in $RHOME were replicated in $HOME, even if those
434 434 files were not created until later.
435 435
436 436 filesync -s $RHOME -d $HOME '*.c'
437 437
438 438
439 439 If any of the destination files already exist, filesync
440 440 ensures that they are identical and issues warnings if they
441 441 are not.
442 442
443 443 Once files have been copied, the distinction between the
444 444 source and destination is a relatively arbitrary one
445 445 (except for its use in the -o and -f switches).
446 446
447 447
448 448 ENVIRONMENT VARIABLES
449 449 FILESYNC
450 450 Specifies the default location of the filesync packing
451 451 rules and baseline files. The default value for this
452 452 variable is $HOME. The suffixes .packingrules and
453 453 .filesync-base will be appended to form the names of the
454 454 packing rules and baseline files.
455 455
456 456
457 457 LC_MESSAGES
458 458 Determines how diagnostic and informative messages are
459 459 presented. In the "C" locale, the messages are presented
460 460 in the default form found in the program itself (in most
461 461 cases, U.S. English).
462 462
463 463
464 464 EXIT STATUS
465 465 Normally, if all files are already up-to-date, or if all files were
466 466 successfully reconciled, filesync will exit with a status of 0.
467 467 However, if either the -n option was specified or any errors occurred,
468 468 the exit status will be the logical OR of the following:
469 469
470 470 0
471 471 No conflicts, all files up to date.
472 472
473 473
474 474 1
475 475 Some resolvable conflicts.
476 476
477 477
478 478 2
479 479 Some conflicts requiring manual resolution.
480 480
481 481
482 482 4
483 483 Some specified files did not exist.
484 484
485 485
486 486 8
487 487 Insufficient permission for some files.
488 488
489 489
490 490 16
491 491 Errors accessing packing rules or baseline file.
492 492
493 493
494 494 32
495 495 Invalid arguments.
496 496
497 497
498 498 64
499 499 Unable to access either or both of the specified src or dst
500 500 directories.
501 501
502 502
503 503 128
504 504 Miscellaneous other failures.
505 505
506 506
↓ open down ↓ |
459 lines elided |
↑ open up ↑ |
507 507 FILES
508 508 $HOME/.packingrules
509 509 list of files to be kept synchronized
510 510
511 511
512 512 $HOME/.filesync-base
513 513 baseline summary file
514 514
515 515
516 516 SEE ALSO
517 - cachefspack(1M), packingrules(4), attributes(5)
517 + packingrules(4), attributes(5)
518 518
519 519
520 520
521 - November 6, 2000 FILESYNC(1)
521 + September 8, 2015 FILESYNC(1)
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX