File: fmirror.1

package info (click to toggle)
fmirror 1%3A0.8.4beta-2
  • links: PTS
  • area: main
  • in suites: potato
  • size: 196 kB
  • ctags: 186
  • sloc: ansic: 2,300; makefile: 56; sh: 46
file content (441 lines) | stat: -rw-r--r-- 11,644 bytes parent folder | download | duplicates (3)
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
.TH FMIRROR 1 "28 Apr 1998" "Guardian Networks" "GN Utilities"
.SH NAME
fmirror \- Mirror directories from ftp servers
.SH SYNOPSIS
.B fmirror
[\-A\ and\-mask]
[\-O\ or\-mask]
[\-C\ config\-line]
[\-N]
[\-c\ dircommand]
[\-d\ log\-level]
[\-e\ exclude\-entry]
[\-i\ include\-entry]
[\-f\ config\-file]
[\-F\ pidfile]
[-h]
[\-l\ local\ dir]
[\-m\ dirmode]
[\-P\ port]
[\-p\ password]
[\-r\ remote\ dir]
[\-s\ hostname]
[\-S]
[\-t\ timefuzz]
[\-u\ username]
[\-v]
[\-V verbosity]
[\-x\ decompressor]
[\-o\ option]
[\-z]
.SH DESCRIPTION
.B fmirror
is a program for mirroring a directory from a remote ftp server. It
allows regex-matching for files that are to be included and
excluded. It uses a combination of timestamp, file size and file
permissions to decide what files to transfer from the ftp server.

The primary goal of
.B fmirror
is to use as little memory as possible, but still be able to do its
job efficiently.
.B fmirror
can delete any files not found on the remote server.

.SH OPTIONS

.TP
.BI "\-A" " mask"
Remote file permissions will be binary anded by
.I mask
before being
compared.  The same mask is also used when creating files. Default
value is 0111, which results in only executable bits being mirrored.
The or mask will be ored in after the and mask is anded in.

.TP
.BI "\-O" " mask"
Remote file permissions will be binary ored by
.I mask
before being
compared. The same mask is also used when creating files. Default
value is 0444, which results in all files being readable for everyone.
This mask will be ored in after the and mask has been anded in.

.TP
.BI "\-C" " line"
Parses
.I line
as if it was a line in a config-file.

.TP
.B "\-N"
Don't delete files that are missing from the ftp server. Files that
are replaced by files of other types will still be deleted and updated.

.TP
.BI "\-c" " command"
Use
.I command
as a dir-command. To read a ls-lR file instead of performing a heavy
ls-operation on the ftp-server, use "RETR ls-lR". The default value is
"LIST -lgRa".

.TP
.BI "\-d" " debug-level"
The level of debugging (spam) output that is wanted. The default debug-level
is 3.

.TP
.BI "\-e" " exclude\-opt exclude\-pattern"
Add an exclude-entry. See discussion for exclude: in the configuration
files section. The option and pattern must be one word to the shell,
so enclose both in a single "-pair, ie <fmirror -e "p old/">.
\#"

.TP
.BI "\-i" " include\-opt include\-pattern"
Add an include-entry. See discussion for include: in the configuration
files section.

.TP
.BI "\-f" " config\-file"
Reads options from
.I config-file.
See the section
.B CONFIGURATION FILES
for more information about the contents of a config-file.

.TP
.BI "\-F" " pid\-file"
Write the pid (process id) of the fmirror process to
.I pid\-file.
This is useful when you want to avoid running more than one copy of
fmirror from cron or similar.

.TP
.B "\-h"
Display brief option-summary.

.TP
.BI "\-l" " local-dir"
Change directory to
.I "local-dir"
(locally) before mirroring.

.TP
.BI "\-m" " mode"
All local directories will be made with mode
.I mode.
Default value is 0755 (octal).

.TP
.BI "\-P" " port"
Connect to port
.I port
on the remote ftp server.

.TP
.BI "\-p" " password"
The password you want to use on the ftp server. When doing anonymous
ftp, this should be your email address. If password is not specified,
it be set to 'username@', where
.I username
is the username corresponding
to the real UID of fmirror.

.TP
.BI "\-r" " remote-dir"
Change directory to
.I "remote-dir"
(on the ftp server) before mirroring.

.TP
.BI "\-s" " hostname"
Use
.I hostname
as the ftp server to connect to.

.TP
.B "\-S"
Use passive mode for the ftp transfers. This is often necessary to get
through some firewalls.

.TP
.BI "\-t" " timefuzz"
Allow timestamps to differ by up to
.I timefuzz
seconds. The default value is 0. No matter what this value is set to,
files that differ by exactly 3600 seconds will always considered equal
to compensate for buggy timezone-handling. Also, files older than 60
days can differ by up to a day to compensate for lack of precision
in ls listings for previous years.

.TP
.BI "\-u" " username"
Sets your username on the ftp server to
.I username.
For anonymous ftp, this should be
.B ftp
or
.B anonymous.
The default value is anonymous.

.TP
.B "\-v"
Show version.

.TP
.BI "\-V" " verbosity"
Verbosity level, 1 is suitable for cron jobs and 3 is suitable for
interactive use. Default is 3.

.TP
.BI "\-x" " program"
Run
.I program
as a decompressor for the ls listing. This will only be used if
compressed dirlisting is on. This should ONLY be the name of the
executable, it must not contain any options. The default value is "gzip".

.TP
.BI "\-o" " option"
Give
.I option
as option to the decompressor. The default value is "-dc".

.TP
.B "-z"
Enable decompression of dir-listing.

.SH CONFIGURATION FILES

Unless you are just using this program to mirror a directory once,
you'll probably want to make a configuration file to make the job
easier.

The syntax of the configuration file is very simple. Any line not
starting with an alphabetical letter is considered a comment line
(blank lines are also considered comments).

The first option of a particular kind has the highest priority,
and configuration file and command line options have the same
priority. You can have any number of include and exclude options, the
first one that matches a particular file will be used.

You can also include multiple configuration files, the first
configuration file has precedence over later ones. The debug-level can
be changed between every single option on the command-line to debug
specific configuration files.

.I NOTE:
All numerical values can be written in octal (leading 0),
decimal (default) or hexadecimal (leading 0x). Modes are usually
written in octal, so make sure you write 0755 and not 755 (for example).

.TP
.BI username: " username"
Sets the username (same as -u command line option). Any whitespace
before the username will be ignored. This will typically be "ftp" or
"anonymous".

.TP
.BI password: " password"
Sets the password (same as -p command line option). Any whitespace
before the password will be ignored. This will typically be
"user@some.domain", ie "finnag@guardian.no"

.TP
.BI host: " remote hostname"
Specifies the remote hostname (same as -s command line option). Any
whitespace before the hostname will be ignored.

.TP
.BI remotedir: " remote directory"
Specifies the remote directory that is to be mirrored. (same as -r
command line option). Any whitespace before the name will be ignored.

.TP
.BI localdir: " local directory"
Specifies the local directory that you are mirroring to (same as -l
command line option). Any whitespace before the name will be ignored.

.TP
.BI dircmd: " directory list command"
Specifies what command should be sent to the ftp-server to get a
directory listing. Normally this is "LIST -lgRa". If you want to get a
ls-lR file instead, you can put "RETR ls-lR" here. This option is
equivalent to the -C command line option.

.TP
.B decompressor:
If you are getting a compressed file-listing, this should be the name
of the decompressor program without any options. This is set to "gzip"
if you only enable compressed dir-listings without specifying a
decompressor. Equivalent to -x command line option.

.TP
.B decompressor_opt:
The option string that is to be sent to the decompressor. This defaults to
"-dc". Equivalent to -o command line option.

.TP
.BI port: " port"
Connect to port
.I port
on the remote ftp server. Equivalent to -P command line option.

.TP
.BI pidfile: " pid\-file"
Store the PID (process id) of the process to the file
.I pid\-file.
Equivalent to -F command line option.


.TP
.BI dirmode: " mode"
All local directories will be created with mode
.B mode.
Equivalent to -m command line option.

.TP
.BI loglevel: " level"
Specifies the logging level (debug level). Equivalent to -l command line
option.

.TP
.BI compressed: " val"
Takes an integer argument, will enable decompressing of the file listing
if
.I val
is non-zero. With a non-zero value this is equivalent to the
-z command line option.

.TP
.BI timefuzz: " fuzz"
The maximum number of seconds files can differ by and still be
considered equal. Equivalent to -t command line option.

.TP
.BI file_and_mask: " mask"
File permissions will be anded by
.I mask
before being compared and created. Equivalent to -A command line option.

.TP
.BI file_or_mask: " mask"
File permissions will be ored by
.I file_or_mask
before being created. Equivalent to -O command line option.

.TP
.BI passive: " val"
Use passive mode if
.I val
is non-zero, or normal mode if it is zero.

.TP
.BI nodel: " val"
Don't delete local files if
.I val
is non-zero (equivalent to -N command line option). Normal operation
if
.I val
is zero.

.TP
.BI log-timestamp: " val"
Only prepend timestamp on each line output if
.I val
is non-zero. Default value is 1.

.TP
.BI verbosity: " verbosity"
Chose verbosity value. The only supported values are 1, which is
suitable for non-interactive operation, and 3, which is suitable for
interactive operation.

.TO

.TP
.BI "exclude:	[i][x][n]{p|f}" "	pattern"
A regex pattern that, if matched in a particular file/path-name,
should not be mirrored. This will override any include-patterns
encountered after this. Equivalent to -e command line option.

.B NOTE:
An exclude-rule doesn't differ between files or directories. p or f
only decide whether the entire path-name or just the name of the
file/directory itself should be matched. Directories get "/" appended
before they are matched against the regex, so "exclude\ f\ ^old/"
will exclude a directory named "old" and all its contents, but not a
file named "old".

.B i
means case insensitive match.

.B x
means to match anything EXCEPT the following regex, effectively
inverting the rule.

.B n
means that the file/directory will not be deleted if it exists locally,
matches this rule, and would otherwise be deleted.

.B p
means match full path-name (eg "pub/foo.bar").

.B f
means match filename only (eg "foo.bar")

.I pattern
is an extended POSIX regular expression.

.TP
.BI "include:	[i][x][n]{p|f}" "	pattern"
A regex pattern that, if matched in a particular file/path-name,
should be mirrored. This will override any exclude-patterns encountered
after this. Equivalent to -i command line option.

The options are identical with the
.B exclude
options.

.SH EXAMPLE CONFIGURATION FILES
There should be several sample configuration files with your copy of
fmirror in the
.B configs
directory.

.SH
BUGS

Transient errors are not handled well. If one file cannot be
transferred for some reason, such as 'Failed to make data socket',
it doesn't try to get that file again, so you effectively lose the file.

.SH COPYING
Copyright 1995\-1998  Finn Arne Gangstad and Tor Egge.
.PP
Permission is granted to make and distribute verbatim copies of
this manual provided the copyright notice and this permission notice
are preserved on all copies.
.PP
Permission is granted to copy and distribute modified versions of this
manual under the conditions for verbatim copying, provided that the
entire resulting derived work is distributed under the terms of a
permission notice identical to this one.
.PP
Permission is granted to copy and distribute translations of this
manual into another language, under the above conditions for modified
versions, except that this permission notice may be included in
translations approved by the Free Software Foundation instead of in
the original English.
.SH AUTHORS
.B fmirror
was written by
.br
Finn Arne Gangstad <finnag@guardian.no>
.br