File: README.html

package info (click to toggle)
ftpmirror 1.2l-7
  • links: PTS
  • area: main
  • in suites: woody
  • size: 260 kB
  • ctags: 139
  • sloc: perl: 3,318; makefile: 56; sh: 47
file content (669 lines) | stat: -rw-r--r-- 25,792 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
<html><head>
<title>ftpmirror - mirroring directory hierarchy with FTP</title>
</head><body>
<h1>FTPMIRROR</h1>

<h2>Introduction</h2>

<i>Ftpmirror</i> is an utility to copy directory hierarchy
(this is called ``mirror'') with FTP.

A similar perl script exists, whose name is `mirror',
but <i>ftpmirror</i> requires less memory than mirror.

You need perl-5.003 or later to use <i>ftpmirror</i>.
Please ensure that perl-5.003 or later was installed in your
environment, at first.

<h2>How to use <i>ftpmirror</i></h2>

<ol>
<li>Install <i>ftpmirror</i> first.
 The newest version of <i>ftpmirror</i> is available from
 <a href=ftp://ftp.intec.co.jp/pub/utils/><b>ftp.intec.co.jp</b></a>.
 Since <i>ftpmirror</i> is a set of perl scripts,
 you must only extract the packages.
 Do one of following:
 <pre>
 [ if you have ftpmirror-x.y.tar.gz ]
 # cd /usr/local/lib
 # gzip -cd < /tmp/ftpmirror-x.y.tar.gz | tar xf -</pre>
 or
 <pre>
 [ if you have ftpmirror-x.y.shar ]
 # cd /usr/local/lib
 # sh /tmp/ftpmirror-x.y.shar</pre>
<li><tt>$prefix</tt> defined in <i>ftpmirror</i> must be configured as
 the install directory.
 The default is <tt>/usr/local/lib/ftpmirror</tt>.
 <pre>
 # cd /usr/local/lib/ftpmirror
 # vi +/prefix/ ftpmirror
 ...</pre>
<li>Create default configuration file in the "config" directory
 (Please refer the "default-sample" file).
 This file contains default values described in
 <a href=#params><i>Parameters for ftpmirror</i></a> section.
 <pre>
 # cd /usr/local/lib/ftpmirror/config
 # cp default-sample default
 # vi default
 ...</pre>
<li>Create package configuration files as you need.
 You may define multiple packages in the default configuration file.
 For more details,
 please refer the <a href=#package><i>package</i></a> section.
 The simplest way to configure a package is defining three entry,
 <a href=#ftp-server><tt>ftp-server</tt></a>,
 <a href=#remote-directory><tt>remote-directory</tt></a> and
 <a href=#local-directory><tt>local-directory</tt></a>.
 <pre>
 # cp GNU-sample GNU
 # vi GNU
 ...</pre>
<li>Invoke <i>ftpmirror</i> with the package name.
 <i>Ftpmirror</i> reads the configuration file for the package
 if there is a file, whose name is same as the package name,
 in the current directory or the "config" directory,
 <pre>
 # /usr/local/lib/ftpmirror/ftpmirror FreeBSD</pre>
<li>Any information about transfer is written to STDOUT.
</ol>

<h2><a name=params>Parameters for <i>ftpmirror</i></a></h2>

You can define parameters for <i>ftpmirror</i> with
the default configuration file,
package specific configuration file,
and <a href=#run-time>run-time option</a>s.
<i>Ftpmirror</i> overwrites parameters in order above,
e.g., run-time options are most preferred.
<p>
There are many acceptable parameters as follows:
<ul>
<li><b>Parameters for system and behavior</b>
 <ul>
 <li><a name=local-hostname>local-hostname</a>: (default: `hostname`)<br>
  The hostname where <i>ftpmirror</i> is invoked.

 <li><a name=debug>debug</a>: (default: 0, for backward compatibility)<br>
  Set this parameter to 1 if you want see more information
  in mirror session. This is only for backward compatibility.
  <tt>debug=1</tt> is equivalent to
  <tt><a href=#log-priority>log-priority</a>=6</tt>.

 <li><a name=log-priority>log-priority</a>: (default: 5)<br>
  Loggin level. Currently, following priorities are supported.
  <ul>
  <li>0 ... EMERG : Emergency logs. Currently, nothing will be logged.
  <li>4 ... WARNING : Warning logs.
  <li>5 ... NOTICE : Logs for file transfer or file unlink.
  <li>6 ... INFO : Logs in compare routine, or others.
  <li>7 ... DEBUG : Any logs, this generates too many outputs.
  </ul>

 <li><a name=test-mode>test-mode</a>: (default: 0)<br>
  If this parameter is 1, <i>ftpmirror</i> prints file names to transfer
  or to unlink, but no real action is performed.
 </ul>
<li><b>Parameters for FTP session</b>
 <ul>
 <li><a name=ftp-server>ftp-server</a>: (default: none)<br>
  The server name to connect FTP session. This must be specified
  for each package.

 <li><a name=ftp-gateway>ftp-gateway</a>: (default: none)<br>
  Specify this parameter if you use FTP proxy gateway such as
  <a href=http://www.tis.com/docs/products/fwtk/>
  TIS Internet FireWall ToolKit</a>.
  You may define this with <a name=server>server</a> parameter. 

 <li><a name=ftp-user>ftp-user</a>: (default: anonymous)<br>
  Login name for FTP session. If you want to use anonymous FTP,
  please specify "anonymous" as this parameter.

 <li><a name=ftp-pass>ftp-pass</a>: (default: ftp-admin@`hostname`)<br>
  Password for FTP session.

 <li><a name=ftp-group>ftp-group</a>: (default: none)<br>
  If you want change group id after logged to the server,
  specify the group name.
  This must be specified with <a href=#ftp-gpass><tt>ftp-gpass</tt></a>.

 <li><a name=ftp-gpass>ftp-gpass</a>: (default: none)<br>
  If you want change group id after logged to the server,
  specify a password to change group.
  This must be specified with <a href=#ftp-group><tt>ftp-group</tt></a>.

 <li><a name=ftp-passive>ftp-passive</a>: (default: 0)<br>
  Set this parameter to 1 if passive connection(PASV command in FTP)
  is required. This helps you if you use <i>ftpmirror</i> over
  a SYN/ACK style firewall.

 <li><a name=ftp-idle>ftp-idle</a>: (default: 0)<br>
  If this parameter is not zero, <i>ftpmirror</i> tries to set idle timer
  of FTP session to this value.
  FTP server must support SITE IDLE command.

 <li><a name=ftp-max-idle>ftp-max-idle</a>: (default: 0)<br>
  If this parameter is not zero, <i>ftpmirror</i> tries to set idle timer
  of FTP session to maximum value.
  FTP server must support SITE IDLE command.

 <li><a name=ftp-list-method>ftp-list-method</a>: (default: stat)<br>
  You can specify which of STAT or LIST command should be used to get
  server's directory entries. Since STAT command returns server's
  directory entries over control connection, it is little faster than
  LIST command. Some ftp server software does not returns directory
  entry which is required by <i>ftpmirror</i>, in that case you must
  speficy as <b>ftp-list-method = list</B>.
 </ul>
<li><b>Parameters for a package</b>
 <ul>
 <li><a name=package>package</a>: (default none)<br>
  Specify the package name. This is useful if you want to have
  multiple package entries in a single configuration file.
  Any parameters defined after "package" are treated as a package
  specific parameter.

 <li><a name=server>server</a>: (default none)<br>
  This is used to define FTP server specific parameters.
  After this parameter, any parameter are treated as the server
  specific parameter,
  until package or (next)server parameter will be found.
  Especially, it's reasonable to specify
  <a href=#ftp-gateway>ftp-gateway</a>,
  <a href=#ftp-passive>ftp-passive</a>,
  <a href=#remote-timezone>remote-timezone</a>, ...
  as server parameters.
  For example, here is the author's configuration:
  <pre>
  # in default setting, most ftp-servers requires proxy.
  ftp-gateway = proxy.intec.co.jp
  # in local network
  server = ftp.intec.co.jp
  undef ftp-gateway
  # use another proxy gateway, and define offset
  server = ftp.triton.ad.jp
  ftp-gateway = proxy2.intec.co.jp
  remote-timezone = +0900
  # any packages below
  package = ...</pre>
 <li><a name=load-package>load-package</a><br>
  If this parameter is defined for a package,
  ftpmirror tries to overload any parameters
  from another package specified by this parameter.
  Note that the package specified in this parameter must be
  defined before this entry.
  This may help you if you use
  <a href=#alternate-package><tt>alternate-package</tt></a>.
 <li><a name=alternate-package>alternate-package</a><br>
  You can perform alternate mirroring session
  when FTP login session for a package was failed.
  Currently, this fail-safe session is performed
  only if LOGIN session was failed.
  Set this parameter to alternate package name
  for alternate session.
  <pre>
  package = FreeBSD
   ftp-server = ftp.freebsd.org
   remote-directory = /pub/FreeBSD
   local-directory = ~/pub/FreeBSD
   lslR-file = /pub/FreeBSD/ls-lR.gz
   alternate-package = FreeBSD-original
  package = FreeBSD-triton
   load-package = FreeBSD
   ftp-server = ftp.triton.ad.jp</pre>
 </ul>
<li><b>Parameters about mirroring</b>
 <ul>
 <li><a name=unlink>unlink</a>: (default: yes)<br>
  Set this parameter "yes" or 1 if you want to unlink a file
  which is removed from servers directory.
  You may set this parameter as "rename",
  in this case, <i>ftpmirror</i> renames a file with a trailing Tilda('~').

 <li><a name=unlink-limit>unlink-limit</a>: (default: 0)<br>
  If this parameter is defined, <i>ftpmirror</i> will not remove
  large files or large directories.
  This may help you when server side directory hierachy is
  dramatically changed.
  For example, if <tt>unlink-limit</tt> is defined as 30M,
  any file or directory who is larger than 30Mbytes will not
  be removed. You may also specify 500K or 3G as the maximum size.
  When <tt>unlink-limit</tt> is defined as 100 (e.g. no size suffix),
  <i>ftpmirror</i> will not remote the directory who has more than
  100 entries.

 <li><a name=compare-stat>compare-stat</a>: (default: 1)<br>
  In compare routine, <i>ftpmirror</i> can use results of STAT/LIST or
  results of SIZE/MDTM. If compare-stat is 1, <i>ftpmirror</i> tries to
  use results of STAT/LIST to compare local/remote files.
  Please set <a href=#list-method><tt>list-method</tt></a> parameter to
  control which of STAT/LIST would be used.

 <li><a name=check-mtime>check-mtime</a>: (default: 1)<br>
  By default, <i>ftpmirror</i> try to check modified times of local and
  remote files. If this parameter is zero, <i>ftpmirror</i> does NOT
  check modified time.
  In this case, if local and remote files have same size <i>ftpmirror</i>
  will only change local file timestamp to match remote one.

 <li><a name=list-method>list-method</a>: (default: STAT)<br>
  By default, <i>ftpmirror</i> tries to send STAT command to get FTP server's
  directory entries. But, in some cases, STAT does not work well.
  In these case, set this parameter to "LIST".

 <li><a name=remote-timezone>remote-timezone</a>: (default: undef)<br>
  Specify the timezone of FTP server.
  Since MDTM command returns GMT time stamp, this is useful only if you
  run <i>ftpmirror</i> with <tt><a href=#compare-stat>compare-stat</a>=1</tt>.
  (<i>ftpmirror</i> tries to calculate server's timezone automatically,
   if you don't specify remote-timezone).
  For example, you may specify <tt>remote-timezone = +0900</tt>
  if FTP server's timezone is JST.
  Currently, summer time is not supported.

 <li><a name=lock-directory>lock-directory</a>: (default: /tmp)<br>
  <i>Ftpmirror</i> use lock mechanism
  to avoid invoking multiple <i>ftpmirror</i>s for a package.
  lock-directory parameter means the directory to create lock file.

 <li><a name=temp-directory>temp-directory</a>: (default: /tmp)<br>
  <i>Ftpmirror</i> stores temporary files to the directory specified by
  this parameter. Currently, ls-lR or dirinfo files may be stored
  in this directory.

 <li><a name=home-directory>home-directory</a>: (default: ~ftp)<br>
  You can omit some portion of the directory name
  to specify <a href=#local-directory><tt>local-directory</tt></a>
  with Tilda('~') notation.
  A Tilda in local-directory parameter is replaced with
  the value of this parameter.
  By default, the home directory of the "ftp" user is stored in
  this parameter.

 <li><a name=remote-directory>remote-directory</a>: (default: none)<br>
  You must specify the directory on the FTP server where you want to mirror
  as this parameter.
  Any mirror is recursively performed from this directory.

 <li><a name=local-directory>local-directory</a>: (default: none)
  You must set this parameter to the directory in local-side host,
  e.g. the directory paired with
  <a name=remote-directory>remote-directory</a>.
  Next example shows that <i>ftpmirror</i> will mirror
  "/pub/FreeBSD" in the FTP server
  to "/ftp/pub/FreeBSD" in local.
  <pre>
  remote-directory = /pub/FreeBSD
  local-directory = /ftp/pub/FreeBSD</pre>
  If home-directory is defined (or ftp user's home directory exists),
  you can specify as follows:
  <pre>
  remote-directory = /pub/FreeBSD
  local-directory = ~/pub/FreeBSD</pre>

 <li><a name=lslR-file>lslR-file</a>: (default: none)<br>
  You can use ls-lR(or similar) on the FTP server rather than
  directory scan with STAT/LIST. Specify server side filename
  of ls-lR(or similar) as this parameter.
  If <tt>lslR-file</tt> has an extension of .gz or .Z,
  gunzip or uncompress will be automatically invoked.
  For example, if you mirror ftp.freebsd.org:/pub/FreeBSD with ls-lR.gz,
  you may specify as next:
  <pre>
  ftp-server = ftp.freebsd.org
  remote-directory = /pub/FreeBSD
  local-directory = ~/pub/FreeBSD
  lslR-file = /pub/FreeBSD/ls-lR.gz</pre>

 <li>lslR-map: (default: none)<br>
  When you use <a href=#lslR-file><tt>lslR-file</tt></a>,
  an output of ls -lR (that is, contents of lslR-file)
  may have invalid top directory.
  This is because, the directory where ls -lR was invoked is site-dependent.
  You can specify substitute rules of the path name with lslR-map.
  For example,
  <a href=ftp://ftp.iij.ad.jp/pub/GNU/ls-lR.Z>
  <tt>ftp.iij.ad.jp:/pub/GNU/ls-lR.Z</tt></a> has path names such as
  <tt>GNU/gcc-2.7.2.tar.gz</tt>, but prepended <tt>GNU</tt> should
  be dot('.') to mirror the directory hierarchy.
  In this case, you should define <tt>lslR-map</tt> as:
  <pre>
  lslR-file = /pub/GNU/ls-lR.Z
  lslR-map = /^GNU/./</pre>

 <li>transfer-file-regexp: (default: matches all)<br>
  Regular expressions(perl's regular expression) to match filenames
  to transfer.
  <i>Ftpmirror</i> tries to transfer only files on the server
  which matches to this expression.
  Any filename on the FTP server is represented as relative path
  (from remote-directory) beginning with "./".
  That is, if remote-directory is configured as "/pub/FreeBSD",
  the file "/pub/FreeBSD/2.1.5-RELEASE/README.TXT" on the server
  is represented as "./2.1.5-RELEASE/README.TXT".<br>
  <p>
  Some examples follow:
  <pre>
  transfer-file-regexp += !/~$/
  transfer-file-regexp += !/\/\.in/
  transfer-file-regexp += !/\/\.nfs/</pre>
  With this configuration, <i>ftpmirror</i> does NOT transfer files
  end with "~" and begin with ".in" or ".nfs".
  <p>
  (Notes: "=" means replacing a parameter value,
   and "+=" means appending a parameter string)
  <pre>
  transfer-file-regexp += /\/bash-/
  transfer-file-regexp += /\/gcc-/
  transfer-file-regexp += !</pre>
  With adobe configuration, <i>ftpmirror</i> tries to transfer bash-* and
  gcc-* files, but not others.
  The last line in this example means
  <i>ftpmirror</i> does NOT transfer by default.

 <li>transfer-directory-regexp: (default: matches all)<br>
  Regular expressions(perl's regular expression) to match directory
  names to scan in a FTP server.
  Note that any directory in a FTP server is represented with trailing
  slash ('/').
  For example, next shows configuration to avoid <i>ftpmirror</i>
  NOT to scan(off course, this means NOT to transfer) directories
  whose names are "lost+found", or directories ended with '~'.
  <pre>
  transfer-directory-regexp += !/\/lost+found\/$/
  transfer-directory-regexp += !/~\/$/</pre>

  <li>override-file-regexp: (default: matches all)<br>
  Regular expressions(perl's regular expression) to match files
  you can override in local directories.
  In actual mirror session,
  <i>ftpmirror</i> tries to transfer files which match
  <tt>transfer-file-regexp</tt>,
  and also match <tt>override-file-regexp</tt>.
  Any file which does not match <tt>override-file-regexp</tt>
  will not be modified by <i>ftpmirror</i>.
  In the next example, <i>ftpmirror</i> tries to transfer bash-* files,
  but not modified any other files. This is useful when you want
  to get files from multiple FTP servers
  to a single local-side directory.
  <pre>
  transfer-file-regexp += /\/bash-/
  transfer-file-regexp += !
  override-file-regexp += /\/bash-/
  override-file-regexp += !</pre>

  <li>override-directory-regexp: (default: matches all)<br>
  Regular expressions(perl's regular expression) to match directories
  <i>ftpmirror</i> will modify.
  You can transfer directories from multiple FTP
  servers to a single local-side directory with this parameter.
  Following example shows that you can transfer the FreeBSD-nonUS
  into the FreeBSD directory.
  <pre>
  package = FreeBSD
   ftp-server = ftp.tokyonet.ad.jp
   remote-directory = /pub/FreeBSD
   local-directory = ~/pub/FreeBSD
   override-directory-regexp += !/\.\/FreeBSD-nonUS\//

  package = FreeBSD-nonUS
   ftp-server = ftp.waseda.ac.jp
   remote-directory = /pub/FreeBSD-nonUS
   local-directory = ~/pub/FreeBSD/FreeBSD-nonUS</pre>

 <li>md5-program: (default: path name for md5 program if exists)<br>
  Used to calculate MD5 checksum when you use
  <a href=#dirinfo>directory information</a> described below.

 <li>load-local-dirinfo: (default: 0)<br>
  Set this parameter to 1 if you want to load local ".dirinfo" files.
  A ".dirinfo" file contains
  <a href=#dirinfo>directory information</a> described below.

 <li>store-local-dirinfo: (default: 0)<br>
  Set this parameter to 1 if you want to generate ".dirinfo" files
  in local-side directories after each mirror session.
  A ".dirinfo" file contains
  <a href=#dirinfo>directory information</a> described below.

 <li>load-remote-dirinfo: (default: 0)</br>
  Set this parameter to 1 if you want to load and use directory
  information stored in the FTP server.
  Using <a href=#dirinfo>directory information</a>,
  you can mirror files without STAT/LIST/SIZE/MDTM,
  and <i>ftpmirror</i> can check MD5 checksum of files.

 <li>override-file-uid: (default: 0)<br>
  You can specify owner of files/directories in local. Any files
  and directories which match <tt>override-*-regexp</tt>,
  will be owned by this user id.
  If <i>ftpmirror</i> is invoked by non privileged user,
  this parameter is ignored.

 <li>override-file-gid: (default: 0)<br>
  Same as <a href=#override-file-uid><tt>override-file-uid</tt></a>,
  but this parameter is for group id.
  Note that if one of <tt>override-file-uid</tt>
  and <tt>override-file-gid</tt> is defined,
  any file which matches <tt>override-*-regexp</tt> (even if it is
  not transfered) will be modified with chown.

 <li>override-file-mode: (default: root -> 0444, other -> 0644)<br>
  You can specify local-side file mode.
  <i>Ftpmirror</i> applies chmod to any file which matches
  <tt>override-*-regexp</tt> if this parameter is specified.

 <li>override-directory-mode: (default: 0755)<br>
  Same as <a href=#override-file-mode><tt>override-file-mode</tt></a>,
  but this parameter is for directories.

 <li>default-file-uid: (default: 0)<br>
  Undef <a href=#override-file-uid><tt>override-file-uid</tt></a>,
  and set this parameter to specify default owner of local-side files.
  <i>Ftpmirror</i> decides file owner in order:
  <tt>override-file-uid</tt>, owner in FTP server,
  <tt>default-file-uid</tt>.

 <li>default-file-gid: (default: 0)<br>
  Same as <tt>default-file-uid</tt>, but this parameter is for group id.

 <li>default-file-mode: (default: root -> 0444, other -> 0644)<br>
  Undef <a href=#override-file-mode><tt>override-file-mode</tt></a>
  and you can specify default file mode.
  <i>Ftpmirror</i> tries to change file mode
  in order: <tt>override-file-mode</tt>,
  file mode in FTP server, <tt>default-file-mode</tt>.
  Note that since file mode is masked with 0777, you can not set
  setuid/setgid file modes.

 <li>default-directory-mode: (default: 0755)<br>
 Same as <a href=#default-file-mode><tt>default-file-mode</tt></a>,
 but this parameter is for a directory mode.
 </ul>
</ul>

<h2><a name=run-time>Parameters from run-time options</a></h2>

 You can specify parameters by command line options.
 For example, if you want to invoke <i>ftpmirror</i> with test mode
 (no actual transfer), you can type:
 <pre>
 # ftpmirror --test-mode=1 FreeBSD</pre>
 As in this example, any parameter must be prepended by "--"
 in command line options.
 <p>
 Parameters are configured as follows:
 <ol>
 <li>Parameters defined in command line option are most preferred.
 <li>If not defined in command line option, parameters in package
  specific configuration file is used.
 <li>If defined in neither command line option nor package
  specific configuration file, <i>ftpmirror</i> activates parameters in
  the default configuration file.
 <li>Otherwise, <i>ftpmirror</i>'s default value
  (defined in param.pl) is used.
 </ol>

<h2><a name=dirinfo>About directory information</a></h2>

 <i>Ftpmirror-1.2</i> or later can generate or use directory information.
 Directory information is stored in ".dirinfo" file in each directory,
 and used by <i>ftpmirror</i> in directory compare stage.
 Using directory information, you can mirror directory hierarchy more
 efficiently, and more completely.
 <p>
 For example, directory information contains following entries:
 <pre>
 file = LICENSE
  md5checksum = 83cdabcad3c9c3480faa6a75c47c7207
  modified = 800142639
  size = 4631
  owner = root
  group = wheel
 directory = OLD
  begin-update = 842336105
  end-update = 842336105
  owner = root
  group = wheel
 symlink = Welcome.html
  linkto = ../index.html
  owner = root
  group = wheel
 directory = archive
  begin-update = 842336105
  end-update = 842336105
  owner = root
  group = wheel
 file = index
  md5checksum = b5aeac559ee486a0f12493ce52f216f9
  modified = 801170780
  size = 799
  owner = root
  group = wheel
 ....</pre>

 In directory information,
 any file must be defined in a file-type entry.
 Currently, there are three file-types:
 <ol>
 <li><tt>file = file-name</tt> ... a normal file
 <li><tt>symlink = link-file</tt> ... a symbolic link
 <li><tt>directory = dir-name</tt> ... a directory
 </ol>
 and, each file-type is followed by some parameters:
 <ol>
 <li><b>file</b> file-type<br>
  <ul>
  <li>size
  <li>modified (last modified time)
  <li>md5checksum
  <li>owner
  <li>group
  </ul>
 <li><b>symlink</b> file-type<br>
  <ul>
  <li>linkto
  <li>owner
  <li>group
  </ul>
 <li><b>directory</b> file-type<br>
  <ul>
  <li>begin-update (start time of last update)
  <li>end-update (end time of last update)
  <li>owner
  <li>group
  </ul>
 </ol>

 <i>Ftpmirror</i> tries to compare files in local
 and remote with these entries.
 For example, <i>ftpmirror</i> compares as:
 <ol>
 <li><b>file</b> file-type<br>
  Are sizes same? and are md5checksums same?
 <li><b>symlink</b> file-type<br>
  Do they point same file?
 <li><b>directory</b> file-type<br>
  Is the begin-time of last update of local directory is before
  the end-time of last update of remote directory?
 </ol>
 Especially, comparing directory update times are effective,
 if no file is changed in the remote directory, because <i>ftpmirror</i>
 do nothing about the directory (even directory scan is skipped).
 <p>
 <i>Ftpmirror</i> generate ".dirinfo" file
 if <a href=#store-local-dirinfo><tt>store-local-dirinfo</tt></a> parameter
 is 1. You can also generate this file with mkdirinfo:
 <pre>
 # mkdirinfo /ftp/pub/utils</pre>

<h2>mirror.sh - auto mirroring script</h2>

 <i>Ftpmirror</i> package contains shell script mirror.sh.
 This is a script to mirror automatically(e.g., by using cron).
 The author mirrors by this script, daily, weekly and monthly.

 Here is a simple way to use mirror.sh
 <ol>
 <li>Create list.xxx in the directory defined as <tt>$prefix</tt>.
  This file contains a list of package names you want to mirror.
  An empty line or a line begins with # is ignored.
 <li>Invoke mirror.sh. If you create <tt>$prefix/list.daily</tt> in
  adobe stage, please type:
  <pre>
  # /usr/local/lib/ftpmirror/mirror.sh daily</pre>
  and, you can mirror all packages in the list file.
 <li>By default, any output is logged to <tt>/var/log/mirror.xxx</tt>
  if you use mirror.sh. Mirror.sh rotate these log files with
  <a href=ftp://ftp.intec.co.jp/pub/utils/rotate-1.1.tar.gz>
  <b>rotate</b></a>. So you should install this package,
  or comment out some potion calling rotate from mirror.sh.
 </ol>

<h2>Notice</h2>

 <i>Ftpmirror</i> uses STAT or LIST, and SIZE/MDTM commands
 to compare files in local and remote directory.
 Since LIST command requires new TCP
 connection per command, it may take many time if network is so slow.
 Using ls-lR files (or directory information, if server supports it)
 may be efficient, if you must mirror on a slow network.
 <p>
 If clocks of FTP server and local machine are different too much,
 <i>ftpmirror</i> may fail to transfer files.
 Please keep your clock of your machine correctly.
 NTP is a good way to keep your clock right.

<h2>Mailing list for <i>ftpmirror</i></h2>

 Technical questions, suggestions, bug reports are welcome.
 If you are interesting to <i>ftpmirror</i>, there is a mailing-list
 to discuss about <i>ftpmirror</i>.
 To subscribe, send a message
 <pre>
 subscribe ftpmirror</pre>
 to <a href=mailto:majordomo@ftp.intec.co.jp>
 majordomo@ftp.intec.co.jp</a>.

<h2>Credits</h2>

 I would like to thank to anyone who helped me by testing,
 bug-reports, suggestions, sending patches.
 Especially, members in
 <a href=http://ring.etl.go.jp/>RingProject</a> helped me by
 <b>heavy</b> testing <tt>:-)</tt> and many suggestions.

<h2>Miscellaneous...</h2>

 Please read COPYRIGHT for copyright notice.
 Any comments, bug fixes, suggestions are welcome.
 Please contact to
 <a href=mailto:ikuo@intec.co.jp><i>Ikuo Nakagawa
  &lt;ikuo@intec.co.jp&gt;</i></a>.

<hr>
<i>Last updated: 1997/01/27 by Ikuo Nakagawa</i>
</body></html>