~ubuntu-branches/debian/jessie/lftp/jessie

« back to all changes in this revision

Viewing changes to doc/lftp.1

  • Committer: Bazaar Package Importer
  • Author(s): Noèl Köthe
  • Date: 2004-06-01 04:01:39 UTC
  • Revision ID: james.westby@ubuntu.com-20040601040139-negt39q17jhkv3i4
Tags: upstream-3.0.5
Import upstream version 3.0.5

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
.\"
 
2
.\" lftp.1 - Sophisticated ftp program
 
3
.\"
 
4
.\" This file is part of lftp.
 
5
.\"
 
6
.\" This program is free software; you can redistribute it and/or modify
 
7
.\" it under the terms of the GNU General Public License as published by
 
8
.\" the Free Software Foundation; either version 2 of the License , or
 
9
.\" (at your option) any later version.
 
10
.\"
 
11
.\" This program is distributed in the hope that it will be useful,
 
12
.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
14
.\" GNU General Public License for more details.
 
15
.\"
 
16
.\" You should have received a copy of the GNU General Public License
 
17
.\" along with this program; see the file COPYING.  If not, write to
 
18
.\" the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
 
19
.\"
 
20
.\" $Id: lftp.1,v 1.92 2004/05/24 15:16:36 lav Exp $
 
21
.\"
 
22
.\"-------
 
23
.\" Sp  space down the interparagraph distance
 
24
.\"-------
 
25
.de Sp
 
26
.sp \\n(Ddu
 
27
..
 
28
.\"-------
 
29
.\" Ds  begin a display, indented .5 inches from the surrounding text.
 
30
.\"
 
31
.\" Note that uses of Ds and De may NOT be nested.
 
32
.\"-------
 
33
.de Ds
 
34
.Sp
 
35
.in +0.5i
 
36
.nf
 
37
..
 
38
.\"-------
 
39
.\" De  end a display (no trailing vertical spacing)
 
40
.\"-------
 
41
.de De
 
42
.fi
 
43
.in
 
44
..
 
45
.TH lftp 1 "18 May 2004"
 
46
.SH NAME
 
47
lftp \- Sophisticated file transfer program
 
48
.SH SYNTAX
 
49
.B lftp
 
50
[\fB\-d\fR] [\fB\-e \fIcmd\fR] [\fB\-p \fIport\fR]
 
51
[\fB\-u \fIuser\fR[\fB,\fIpass\fR]] [\fIsite\fR]
 
52
.br
 
53
.BI "lftp \-f " script_file
 
54
.br
 
55
.BI "lftp \-c " commands
 
56
.br
 
57
.B lftp \-\-version
 
58
.br
 
59
.B lftp \-\-help
 
60
 
 
61
.SH VERSION
 
62
This man page documents lftp version 3.0.4.
 
63
 
 
64
.SH "DESCRIPTION"
 
65
\fBlftp\fR is a file transfer program that allows sophisticated ftp, http
 
66
and other connections to other hosts. If \fIsite\fR is specified then lftp
 
67
will connect to that site otherwise a connection has to be established with
 
68
the open command.
 
69
.PP
 
70
\fBlftp\fP can handle seven file access methods - ftp, ftps, http, https,
 
71
hftp, fish, sftp and file (https and ftps are only available when lftp is
 
72
compiled with openssl library). You can specify the method to use in `open
 
73
URL' command, e.g. `open http://www.us.kernel.org/pub/linux'. hftp is
 
74
ftp-over-http-proxy protocol. It can be used automatically instead of ftp
 
75
if ftp:proxy is set to `http://proxy[:port]'. Fish is a protocol working
 
76
over an ssh connection to a unix account. SFtp is a protocol implemented
 
77
in ssh2 as sftp subsystem.
 
78
 
 
79
.PP
 
80
Every operation in \fBlftp\fP is reliable, that is any not fatal error is
 
81
ignored and the operation is repeated. So if downloading breaks, it
 
82
will be restarted from the point automatically. Even if ftp server
 
83
does not support REST command, \fBlftp\fP will try to retrieve the file from
 
84
the very beginning until the file is transferred completely.
 
85
 
 
86
\fBlftp\fP has shell-like command syntax allowing you to launch several
 
87
commands in parallel in background (&). It is also possible to group
 
88
commands within () and execute them in background. All background jobs
 
89
are executed in the same single process. You can bring a foreground
 
90
job to background with ^Z (c-z) and back with command `wait' (or `fg' which
 
91
is alias to `wait'). To list running jobs, use command `jobs'. Some
 
92
commands allow redirecting their output (cat, ls, ...) to file or via
 
93
pipe to external command. Commands can be executed conditionally based
 
94
on termination status of previous command (&&, ||).
 
95
.PP
 
96
If you exit \fBlftp\fP when some jobs are not finished yet, \fBlftp\fP will move
 
97
itself to nohup mode in background. The same happens when you have a
 
98
real modem hangup or when you close an xterm.
 
99
.PP
 
100
\fBlftp\fP has builtin mirror which can download or update a whole directory
 
101
tree. There is also reverse mirror (mirror -R) which uploads or
 
102
updates a directory tree on server. Mirror can also synchronize directories
 
103
between two remote servers, using FXP if available.
 
104
.PP
 
105
There is command `at' to launch a job at specified time in current
 
106
context, command `queue' to queue commands for sequential execution
 
107
for current server, and much more.
 
108
.PP
 
109
On startup, \fBlftp\fP executes \fI/etc/lftp.conf\fP and then \fI~/.lftprc\fP and
 
110
\fI~/.lftp/rc\fP. You can place aliases and `set' commands there. Some
 
111
people prefer to see full protocol debug, use `debug' to turn the
 
112
debug on. Use `debug 3' to see only greeting messages and error
 
113
messages.
 
114
.PP
 
115
\fBlftp\fP has a number of settable variables. You can use `set -a' to see
 
116
all variables and their values or `set -d' to see list of defaults.
 
117
Variable names can be abbreviated and prefix can be omitted unless the
 
118
rest becomes ambiguous.
 
119
.PP
 
120
If lftp was compiled with ssl support, then it includes software developed
 
121
by the OpenSSL Project for use in the OpenSSL Toolkit. (http://www.openssl.org/)
 
122
 
 
123
.SS Commands
 
124
.PP
 
125
 
 
126
.BI ! " shell command"
 
127
.PP
 
128
Launch shell or shell command.
 
129
.PP
 
130
.Ds
 
131
!ls
 
132
.De
 
133
.PP
 
134
To do a directory listing of the local host.
 
135
 
 
136
.B alias
 
137
.RI " [" name " [" value ]]
 
138
.PP
 
139
Define or undefine alias \fIname\fP. If \fIvalue\fP is omitted, the alias is
 
140
undefined, else it takes the value \fIvalue\fP. If no argument is given
 
141
the current aliases are listed.
 
142
.PP
 
143
.Ds
 
144
alias dir ls -lF
 
145
alias less zmore
 
146
.De
 
147
 
 
148
.B anon
 
149
.PP
 
150
Sets the user to anonymous.  This is the default.
 
151
 
 
152
.BR at " \fItime\fP [ -- \fIcommand\fP ] "
 
153
.PP
 
154
Wait until the given time and execute given (optional) command. See also at(1).
 
155
 
 
156
.B bookmark
 
157
.RI " [" subcommand ]
 
158
.PP
 
159
The bookmark command controls bookmarks.
 
160
.Ds
 
161
add <name> [<loc>]      add current place or given location
 
162
                        to bookmarks and bind to given name
 
163
del <name>              remove bookmark with name
 
164
edit                    start editor on bookmarks file
 
165
import <type>           import foreign bookmarks
 
166
list                    list bookmarks (default)
 
167
.De
 
168
 
 
169
.B cache
 
170
.RI " [" subcommand ]
 
171
.PP
 
172
The cache command controls local memory cache.
 
173
The following subcommands are recognized:
 
174
.Ds
 
175
stat                    print cache status (default)
 
176
on|off                  turn on/off caching
 
177
flush                   flush cache
 
178
size \fIlim\fP                  set memory limit, -1 means unlimited
 
179
expire \fINx\fP         set cache expiration time to \fIN\fP seconds (\fIx\fP=s)
 
180
                        minutes (\fIx\fP=m) hours (\fIx\fP=h) or days (\fIx\fP=d)
 
181
.De
 
182
.PP
 
183
 
 
184
.BR cat " \fIfiles\fP"
 
185
.PP
 
186
cat outputs the remote file(s) to stdout.  (See also \fBmore\fR,
 
187
\fBzcat\fR and \fBzmore\fR)
 
188
 
 
189
.BR cd " rdir"
 
190
.PP
 
191
Change current remote directory.  The previous remote directory is
 
192
stored as `-'. You can do `cd -' to change the directory back.
 
193
The previous directory for each site is also stored on disk,
 
194
so you can do `open site; cd -' even after lftp restart.
 
195
 
 
196
.BR chmod " \fImode files\fP"
 
197
.PP
 
198
Change permission mask on remote files. The mode must be an octal number.
 
199
 
 
200
.BR close " [" -a "]"
 
201
.PP
 
202
Close idle connections.  By default only with the current server, use
 
203
-a to close all idle connections.
 
204
 
 
205
.BR command " \fIcmd args...\fP
 
206
.PP
 
207
execute given command ignoring aliases.
 
208
 
 
209
.BR debug " [" -o
 
210
.IR file "] "  level "|\fBoff\fP"
 
211
.PP
 
212
Switch debugging to \fIlevel\fP or turn it off.  Use -o to redirect
 
213
the debug output to a file.
 
214
 
 
215
.BR echo " [" -n "] \fIstring\fR"
 
216
.PP
 
217
guess what it does.
 
218
 
 
219
.BR exit " code"
 
220
.br
 
221
.B exit bg
 
222
.PP
 
223
exit will exit from lftp or move to background if jobs are active.  If
 
224
no jobs are active, \fIcode\fP is passed to operating system as lftp's
 
225
termination status. If \fIcode\fP is omitted, the exit code of last
 
226
command is used.
 
227
.PP
 
228
`exit bg' forces moving to background when cmd:move-background is false.
 
229
 
 
230
.B fg
 
231
.PP
 
232
Alias for `wait'.
 
233
 
 
234
.B find
 
235
.RI " [" directory "] "
 
236
.PP
 
237
List files in the directory (current directory by default) recursively.
 
238
This can help with servers lacking ls -R support. You can redirect output
 
239
of this command.
 
240
 
 
241
.BR ftpcopy
 
242
.PP
 
243
Obsolete. Use one of the following instead:
 
244
.Ds
 
245
get ftp://... -o ftp://...
 
246
get -O ftp://... file1 file2...
 
247
put ftp://...
 
248
mput ftp://.../*
 
249
mget -O ftp://... ftp://.../*
 
250
.De
 
251
or other combinations to get FXP transfer (directly between two ftp servers).
 
252
lftp would fallback to plain copy (via client) if FXP transfer cannot be
 
253
initiated or ftp:use-fxp is false.
 
254
 
 
255
.BR get " [" -E ]
 
256
.RB [ -a "] [" -c "] [" -O
 
257
.RB "\fIbase\fP] \fIrfile\fP [" -o " \fIlfile\fP] ..."
 
258
.PP
 
259
Retrieve the remote file \fIrfile\fP and store it as the local file
 
260
\fIlfile\fP.  If -o is omitted, the file is stored to local file named as
 
261
base name of \fIrfile\fP. You can get multiple files by specifying multiple
 
262
instances of \fIrfile\fP [and -o \fIlfile\fP]. Does not expand wildcards, use
 
263
\fBmget\fR for that.
 
264
.Ds
 
265
-c              continue, reget
 
266
-E              delete source files after successful transfer
 
267
-a              use ascii mode (binary is the default)
 
268
-O <base>       specifies base directory or URL where files should be placed
 
269
.De
 
270
.PP
 
271
Examples:
 
272
.Ds
 
273
get README
 
274
get README -o debian.README
 
275
get README README.mirrors
 
276
get README -o debian.README README.mirrors -o debian.mirrors
 
277
get README -o ftp://some.host.org/debian.README
 
278
get README -o ftp://some.host.org/debian-dir/ (end slash is important)
 
279
.De
 
280
 
 
281
.BR get1
 
282
.RI [ OPTS "] " rfile
 
283
.PP
 
284
Transfer a single file. Options:
 
285
.Ds
 
286
-o <lfile>      destination file name (default - basename of rfile)
 
287
-c              continue, reget
 
288
-E              delete source files after successful transfer
 
289
-a              use ascii mode (binary is the default)
 
290
--source-region=<from-to>
 
291
                transfer specified region of source file
 
292
--target-position=<pos>
 
293
                position in target file to write data at
 
294
.De
 
295
 
 
296
.BR glob " [" -d "] [" -a "]"
 
297
.RB "[" -f "] \fIcommand patterns\fP"
 
298
.PP
 
299
Glob given patterns containing metacharacters and pass result to given command.
 
300
E.g. ``glob echo *''.
 
301
.Ds
 
302
-f      plain files (default)
 
303
-d      directories
 
304
-a      all types
 
305
.De
 
306
 
 
307
.B help
 
308
[\fIcmd\fP]
 
309
.PP
 
310
Print help for \fIcmd\fP or if no \fIcmd\fP was specified print a list of
 
311
available commands.
 
312
 
 
313
.B jobs
 
314
.RB [ -v ]
 
315
.PP
 
316
List running jobs. -v means verbose, several -v can be specified.
 
317
 
 
318
.B kill
 
319
all|\fIjob_no\fP
 
320
.PP
 
321
Delete specified job with \fIjob_no\fP or all jobs.
 
322
(For \fIjob_no\fP see \fBjobs\fP)
 
323
 
 
324
.B lcd
 
325
\fIldir\fP
 
326
.PP
 
327
Change current local directory \fIldir\fP. The previous local
 
328
directory is stored as `-'. You can do `lcd -' to change the directory back.
 
329
 
 
330
.B lpwd
 
331
.PP
 
332
Print current working directory on local machine.
 
333
 
 
334
.B ls
 
335
\fIparams\fP
 
336
.PP
 
337
List remote files. You can redirect output of this command to file or
 
338
via pipe to external command.  By default, ls output is cached, to see
 
339
new listing use
 
340
.B rels
 
341
or
 
342
.B "cache flush."
 
343
 
 
344
.BR mget " [" -c "] [" -d "]"
 
345
.RB [ -a "] [" -E "]"
 
346
.RB [ -O " \fIbase\fP] \fIfiles\fP"
 
347
.PP
 
348
Gets selected files with expanded wildcards.
 
349
.PP
 
350
.Ds
 
351
-c              continue, reget.
 
352
-d              create directories the same as file names and get
 
353
                the files into them instead of current directory.
 
354
-E              delete source files after successful transfer
 
355
-a              use ascii mode (binary is the default)
 
356
-O <base>       specifies base directory or URL where files should be placed
 
357
.De
 
358
 
 
359
.B mirror
 
360
.RI [ OPTS "] [" source
 
361
.RI "[" target "]]"
 
362
.PP
 
363
Mirror specified source directory to local target directory. If target
 
364
directory ends with a slash, the source base name is appended to target
 
365
directory name. Source and/or target can be URLs pointing to directories.
 
366
.PP
 
367
.Ds
 
368
-c, --continue          continue a mirror job if possible
 
369
-e, --delete            delete files not present at remote site
 
370
    --delete-first              delete old files before transferring new ones
 
371
-s, --allow-suid                set suid/sgid bits according to remote site
 
372
    --allow-chown               try to set owner and group on files
 
373
    --ignore-time               ignore time when deciding whether to download
 
374
    --ignore-size               ignore size when deciding whether to download
 
375
    --only-missing              download only missing files
 
376
-n, --only-newer                download only newer files (-c won't work)
 
377
-r, --no-recursion              don't go to subdirectories
 
378
-p, --no-perms          don't set file permissions
 
379
    --no-umask          don't apply umask to file modes
 
380
-R, --reverse           reverse mirror (put files)
 
381
-L, --dereference               download symbolic links as files
 
382
-N, --newer-than=SPEC   download only files newer than specified time
 
383
-P, --parallel[=N]              download N files in parallel
 
384
    --use-pget[-n=N]    use pget to transfer every single file
 
385
-i \fIRX\fP, --include \fIRX\fP include matching files
 
386
-x \fIRX\fP, --exclude \fIRX\fP exclude matching files
 
387
-I \fIGP\fP, --include-glob \fIGP\fP    include matching files
 
388
-X \fIGP\fP, --exclude-glob \fIGP\fP    exclude matching files
 
389
-v, --verbose[=level]   verbose operation
 
390
    --log=FILE          write lftp commands being executed to FILE
 
391
    --script=FILE               write lftp commands to FILE, but don't execute them
 
392
    --just-print, --dry-run     same as --script=-
 
393
    --use-cache         use cached directory listings
 
394
--Remove-source-files   remove files after transfer (use with caution)
 
395
-a                      same as --allow-chown --allow-suid --no-umask
 
396
.De
 
397
.PP
 
398
When using -R, the first directory is local and the second is remote.
 
399
If the second directory is omitted, base name of first directory is used.
 
400
If both directories are omitted, current local and remote directories are used.
 
401
.PP
 
402
\fIRX\fP is an extended regular expression, just like in
 
403
.BR egrep (1).
 
404
.PP
 
405
\fIGP\fP is a glob pattern, e.g. `*.zip'.
 
406
.PP
 
407
Include and exclude options can be specified multiple times. It means that
 
408
a file or directory would be mirrored if it matches an include and does
 
409
not match to excludes after the include, or does not match anything
 
410
and the first check is exclude. Directories are matched with a slash appended.
 
411
.PP
 
412
Note that when -R is used (reverse mirror), symbolic links are not created
 
413
on server, because ftp protocol cannot do it. To upload files the links refer
 
414
to, use `mirror -RL' command (treat symbolic links as files).
 
415
.PP
 
416
For option --newer-than you can either specify a file or time specification
 
417
like that used by at(1) command, e.g. `now-7days' or `week ago'. If you
 
418
specify a file, then modification time of that file will be used.
 
419
.PP
 
420
Verbosity level can be selected using \-\-verbose=level option or by several
 
421
\-v options, e.g. \-vvv. Levels are:
 
422
.Ds
 
423
0 - no output (default)
 
424
1 - print actions
 
425
2 - +print not deleted file names (when -e is not specified)
 
426
3 - +print directory names which are mirrored
 
427
.De
 
428
.PP
 
429
\-\-only\-newer turns off file size comparision and uploads/downloads
 
430
only newer files even if size is different. By default older files are transferred and replace newer ones.
 
431
.PP
 
432
You can mirror between two servers if you specify URLs instead of directories.
 
433
FXP is used automatically for transfers between ftp servers, if possible.
 
434
 
 
435
.B mkdir
 
436
.RB "[" -p "] " \fIdir(s)\fP
 
437
.PP
 
438
Make remote directories. If -p is used, make all components of paths.
 
439
 
 
440
.B module
 
441
.IR "module " [ " args " ]
 
442
.PP
 
443
Load given module using dlopen(3) function. If module name does not contain
 
444
a slash, it is searched in directories specified by module:path variable.
 
445
Arguments are passed to module_init function. See README.modules for technical
 
446
details.
 
447
 
 
448
.B more
 
449
\fIfiles\fP
 
450
.PP
 
451
Same as `cat \fIfiles\fP | more'. if \fBPAGER\fP is set, it is used as filter.
 
452
(See also \fBcat\fR, \fBzcat\fR and \fBzmore\fR)
 
453
 
 
454
.BR mput " [" -c "] [" -d "]"
 
455
.RB [ -a "] [" -E "]"
 
456
.RB [ -O " \fIbase\fP] \fIfiles\fP"
 
457
.PP
 
458
Upload files with wildcard expansion. By default it uses the base name of
 
459
local name as remote one. This can be changed by `-d' option.
 
460
.Ds
 
461
-c              continue, reput
 
462
-d              create directories the same as in file names and put the
 
463
                files into them instead of current directory
 
464
-E              delete source files after successful transfer (dangerous)
 
465
-a              use ascii mode (binary is the default)
 
466
-O <base>       specifies base directory or URL where files should be placed
 
467
.De
 
468
 
 
469
.B mrm
 
470
\fIfile(s)\fP
 
471
.PP
 
472
Same as `glob rm'. Removes specified file(s) with wildcard expansion.
 
473
 
 
474
.B mv
 
475
\fIfile1\fP \fIfile2\fP
 
476
.PP
 
477
Rename \fIfile1\fP to \fIfile2\fP.
 
478
 
 
479
.B nlist
 
480
[\fIargs\fP]
 
481
.PP
 
482
List remote file names
 
483
 
 
484
.B open
 
485
.RB [ -e " \fIcmd\fP]"
 
486
.BR "[" -u " \fIuser\fP[", "\fIpass\fP]]"
 
487
.BR "[" -p " \fIport\fP] \fIhost\fP|\fIurl\fP"
 
488
.PP
 
489
Select an ftp server.
 
490
 
 
491
.B pget
 
492
.RI [ OPTS "] " rfile " [" "\fB-o\fP lfile"
 
493
.RI ]
 
494
 
 
495
Gets the specified file using several connections. This can speed up
 
496
transfer, but loads the net heavily impacting other users. Use only if
 
497
you really have to transfer the file ASAP, or some other user may go
 
498
mad :) Options:
 
499
.Ds
 
500
-n      \fImaxconn\fP  set maximum number of connections (default 5)
 
501
.De
 
502
.PP
 
503
 
 
504
.BR put " [" -E ]
 
505
.RB [ -a "] [" -c "]"
 
506
.RB "[" -O " \fIbase\fP] \fIlfile\fP [" -o \fIrfile\fP]
 
507
.PP
 
508
Upload \fIlfile\fP with remote name \fIrfile\fP. If -o omitted, the base name
 
509
of \fIlfile\fP is used as remote name. Does not expand wildcards, use \fBmput\fR for that.
 
510
.Ds
 
511
-o <rfile>      specifies remote file name (default - basename of lfile)
 
512
-c              continue, reput
 
513
                it requires permission to overwrite remote files
 
514
-E              delete source files after successful transfer (dangerous)
 
515
-a              use ascii mode (binary is the default)
 
516
-O <base>       specifies base directory or URL where files should be placed
 
517
.De
 
518
 
 
519
.B pwd
 
520
.PP
 
521
Print current remote directory.
 
522
 
 
523
.B queue
 
524
.RB [ -n " \fInum\fP ] \fIcmd\fP"
 
525
.PP
 
526
Add the given command to queue for sequential execution. Each site has its own
 
527
queue. `-n' adds the command before the given item in the queue. Don't try to
 
528
queue `cd' or `lcd' commands, it may confuse lftp. Instead
 
529
do the cd/lcd before `queue' command, and it will remember the place in which
 
530
the command is to be done. It is possible to queue up an already running job
 
531
by `queue wait <jobno>', but the job will continue execution even if it is not
 
532
the first in queue.
 
533
.PP
 
534
`queue stop' will stop the queue, it will not execute any new commands,
 
535
but already running jobs will continue to run. You can use `queue stop' to
 
536
create an empty stopped queue. `queue start' will resume queue execution.
 
537
When you exit lftp, it will start all stopped queues automatically.
 
538
.PP
 
539
`queue' with no arguments will either create a stopped queue or print queue
 
540
status.
 
541
 
 
542
.B queue
 
543
.BR "--delete|-d " "[\fIindex or wildcard expression\fP]"
 
544
.PP
 
545
Delete one or more items from the queue. If no argument is given, the last
 
546
entry in the queue is deleted.
 
547
 
 
548
.B queue
 
549
.BR "--move|-m " "<\fIindex or wildcard expression\fP> [\fIindex\fP]"
 
550
.PP
 
551
Move the given items before the given queue index, or to the end if no
 
552
destination is given.
 
553
.PP
 
554
.Ds
 
555
-q      Be quiet.
 
556
-v      Be verbose.
 
557
-Q      Output in a format that can be used to re-queue.
 
558
        Useful with --delete.
 
559
.De
 
560
.PP
 
561
.Ds
 
562
> get file &
 
563
[1] get file
 
564
> queue wait 1
 
565
> queue get another_file
 
566
> cd a_directory
 
567
> queue get yet_another_file
 
568
.De
 
569
.PP
 
570
.Ds
 
571
queue -d 3              Delete the third item in the queue.
 
572
queue -m 6 4            Move the sixth item in the queue before the fourth.
 
573
queue -m "get*zip" 1    Move all commands matching "get*zip" to the beginning
 
574
                        of the queue.  (The order of the items is preserved.)
 
575
queue -d "get*zip"      Delete all commands matching "get*zip".
 
576
.De
 
577
 
 
578
.B quote
 
579
\fIcmd\fP
 
580
.PP
 
581
For FTP - send the command uninterpreted. Use with caution - it can lead to
 
582
unknown remote state and thus will cause reconnect. You cannot
 
583
be sure that any change of remote state because of quoted command
 
584
is solid - it can be reset by reconnect at any time.
 
585
.PP
 
586
For HTTP - specific to HTTP action. Syntax: ``quote <command> [<args>]''.
 
587
Command may be ``set-cookie'' or ``post''.
 
588
.Ds
 
589
open http://www.site.net
 
590
quote set-cookie "variable=value; othervar=othervalue"
 
591
set http:post-content-type application/x-www-form-urlencoded
 
592
quote post /cgi-bin/script.cgi "var=value&othervar=othervalue" > local_file
 
593
.De
 
594
.PP
 
595
For FISH - send the command uninterpreted. This can be used to execute
 
596
arbitrary commands on server. The command must not take input or print ###
 
597
at new line beginning. If it does, the protocol will become out of sync.
 
598
.Ds
 
599
open fish://server
 
600
quote find -name \*.zip
 
601
.De
 
602
 
 
603
.BR "reget \fIrfile\fP " [ -o " \fIlfile\fP]"
 
604
.PP
 
605
Same as `get -c'.
 
606
 
 
607
.B rels
 
608
[\fIargs\fP]
 
609
.PP
 
610
Same as `ls', but ignores the cache.
 
611
 
 
612
.B renlist
 
613
[\fIargs\fP]
 
614
.PP
 
615
Same as `nlist', but ignores the cache.
 
616
 
 
617
.BR repeat " [\fIdelay\fP] [\fIcommand\fP]"
 
618
.PP
 
619
Repeat the command. Between the commands a delay inserted, by default 1 second.
 
620
Example:
 
621
.Ds
 
622
repeat at tomorrow -- mirror
 
623
repeat 1d mirror
 
624
.De
 
625
 
 
626
.BR reput " \fIlfile\fP [" -o " \fIrfile\fP]"
 
627
.PP
 
628
Same as `put -c'.
 
629
 
 
630
.BR rm " [" -r "] [" -f ]
 
631
\fIfiles\fP
 
632
.PP
 
633
Remove remote files.  Does not expand wildcards, use \fBmrm\fR for
 
634
that. -r is for recursive directory remove. Be careful, if something goes
 
635
wrong you can lose files. -f supress error messages.
 
636
 
 
637
.B rmdir
 
638
\fIdir(s)\fP
 
639
.PP
 
640
Remove remote directories.
 
641
 
 
642
.B scache
 
643
[\fIsession\fP]
 
644
.PP
 
645
List cached sessions or switch to specified session.
 
646
 
 
647
.B set
 
648
[\fIvar\fP [\fIval\fP]]
 
649
.PP
 
650
Set variable to given value. If the value is omitted, unset the variable.
 
651
Variable name has format ``name/closure'', where closure can specify
 
652
exact application of the setting. See below for details.
 
653
If set is called with no variable then only altered settings are listed.
 
654
It can be changed by options:
 
655
.PP
 
656
.Ds
 
657
-a      list all settings, including default values
 
658
-d      list only default values, not necessary current ones
 
659
.De
 
660
.PP
 
661
 
 
662
.B site
 
663
\fIsite_cmd\fP
 
664
.PP
 
665
Execute site command \fIsite_cmd\fP and output the result.
 
666
You can redirect its output.
 
667
 
 
668
.BR sleep " \fIinterval\fP "
 
669
.PP
 
670
Sleep given time interval and exit. Interval is in seconds by default, but
 
671
can be suffixed with 'm', 'h', 'd' for minutes, hours and days respectively.
 
672
See also \fBat\fP.
 
673
 
 
674
.BR slot " [\fIname\fP]"
 
675
.PP
 
676
Select specified slot or list all slots allocated. A slot is a connection
 
677
to a server, somewhat like a virtual console. You can create multiple slots
 
678
connected to different servers and switch between them. You can also use
 
679
\fIslot:name\fP as a pseudo-URL evaluating to that slot location.
 
680
.PP
 
681
Default readline binding allows quick switching between slots named 0-9 using
 
682
Meta-0 - Meta-9 keys (often you can use Alt instead of Meta).
 
683
 
 
684
.B source
 
685
\fIfile\fP
 
686
.br
 
687
.B source -e
 
688
\fIcommand\fP
 
689
.PP
 
690
Execute commands recorded in file \fIfile\fP or returned by specified external command.
 
691
.Ds
 
692
source ~/.lftp/rc
 
693
source -e echo help
 
694
.De
 
695
 
 
696
.B suspend
 
697
.PP
 
698
Stop lftp process. Note that transfers will be also stopped until you
 
699
continue the process with shell's fg or bg commands.
 
700
 
 
701
.B user
 
702
\fIuser\fP [\fIpass\fP]
 
703
.br
 
704
.B user
 
705
\fIURL\fP [\fIpass\fP]
 
706
.PP
 
707
Use specified info for remote login. If you specify an URL with user name,
 
708
the entered password will be cached so that futute URL references can use it.
 
709
 
 
710
.B version
 
711
.PP
 
712
Print \fBlftp\fR version.
 
713
 
 
714
.B wait
 
715
[\fIjobno\fP]
 
716
.br
 
717
.B wait all
 
718
.PP
 
719
Wait for specified job to terminate. If jobno is omitted, wait for last
 
720
backgrounded job.
 
721
.PP
 
722
`wait all' waits for all jobs termination.
 
723
 
 
724
.B zcat
 
725
\fIfiles\fP
 
726
.PP
 
727
Same as cat, but filter each file through zcat. (See also \fBcat\fR,
 
728
\fBmore\fR and \fBzmore\fR)
 
729
 
 
730
.B zmore
 
731
\fIfiles\fP
 
732
.PP
 
733
Same as more, but filter each file through zcat. (See also \fBcat\fR,
 
734
\fBzcat\fR and \fBmore\fR)
 
735
 
 
736
.SS Settings
 
737
.PP
 
738
On startup, lftp executes
 
739
.IR "~/.lftprc " and " ~/.lftp/rc" "."
 
740
You can place aliases
 
741
and `set' commands there. Some people prefer to see full protocol
 
742
debug, use `debug' to turn the debug on.
 
743
.PP
 
744
There is also a system-wide startup file in
 
745
.IR /etc/lftp.conf .
 
746
It can be in different directory, see FILES section.
 
747
.PP
 
748
.B lftp
 
749
has the following settable variables (you can also use
 
750
`set -a' to see all variables and their values):
 
751
.TP
 
752
.BR bmk:save-passwords \ (bool)
 
753
save plain text passwords in ~/.lftp/bookmarks on `bookmark add' command.
 
754
Off by default.
 
755
.TP
 
756
.BR cmd:at-exit \ (string)
 
757
the commands in string are executed before lftp exits.
 
758
.TP
 
759
.BR cmd:csh-history \ (bool)
 
760
enables csh-like history expansion.
 
761
.TP
 
762
.BR cmd:default-protocol \ (string)
 
763
The value is used when `open' is used
 
764
with just host name without protocol. Default is `ftp'.
 
765
.TP
 
766
.BR cmd:fail-exit \ (bool)
 
767
if true, exit when an unconditional (without || and && at begin) command fails.
 
768
.TP
 
769
.BR cmd:long-running \ (seconds)
 
770
time of command execution, which is
 
771
considered as `long' and a beep is done before next prompt. 0
 
772
means off.
 
773
.TP
 
774
.BR cmd:ls-default \ (string)
 
775
default ls argument
 
776
.TP
 
777
.BR cmd:move-background " (boolean)"
 
778
when false, lftp refuses to go to background when exiting. To force it, use `exit bg'.
 
779
.TP
 
780
.BR cmd:prompt \ (string)
 
781
The prompt. lftp recognizes the following backslash-escaped special
 
782
characters that are decoded as follows:
 
783
 
 
784
.RS
 
785
.PD 0
 
786
.TP
 
787
.B \e@
 
788
insert @ if current user is not default
 
789
.TP
 
790
.B \ea
 
791
an ASCII bell character (07)
 
792
.TP
 
793
.B \ee
 
794
an ASCII escape character (033)
 
795
.TP
 
796
.B \eh
 
797
the hostname you are connected to
 
798
.TP
 
799
.B \en
 
800
newline
 
801
.TP
 
802
.B \es
 
803
the name of the client (lftp)
 
804
.TP
 
805
.B \eS
 
806
current slot name
 
807
.TP
 
808
.B \eu
 
809
the username of the user you are logged in as
 
810
.TP
 
811
.B \eU
 
812
the URL of the remote site (e.g., ftp://g437.ub.gu.se/home/james/src/lftp)
 
813
.TP
 
814
.B \ev
 
815
the version of \fBlftp\fP (e.g., 2.0.3)
 
816
.TP
 
817
.B \ew
 
818
the current working directory at the remote site
 
819
.TP
 
820
.B \eW
 
821
the base name of the current working directory at the remote site
 
822
.TP
 
823
.B \e\fInnn\fP
 
824
the character corresponding to the octal number \fInnn\fP
 
825
.TP
 
826
.B \e\e
 
827
a backslash
 
828
.TP
 
829
.B \e?
 
830
skips next character if previous substitution was empty.
 
831
.TP
 
832
.B \e[
 
833
begin a sequence of non-printing characters, which could be used to
 
834
embed a terminal control sequence into the prompt
 
835
.TP
 
836
.B \e]
 
837
end a sequence of non-printing characters
 
838
.PD
 
839
.RE
 
840
 
 
841
.TP
 
842
.BR cmd:remote-completion \ (bool)
 
843
a boolean to control whether or not lftp uses remote completion.
 
844
.TP
 
845
.BR cmd:verify-host \ (bool)
 
846
if true, lftp resolves host name immediately in `open' command.
 
847
It is also possible to skip the check for a single `open' command if `&' is given,
 
848
or if ^Z is pressed during the check.
 
849
.TP
 
850
.BR cmd:verify-path \ (bool)
 
851
if true, lftp checks the path given in `cd' command.
 
852
It is also possible to skip the check for a single `cd' command if `&' is given,
 
853
or if ^Z is pressed during the check.
 
854
Examples:
 
855
.Ds
 
856
set cmd:verify-path/hftp://* false
 
857
cd directory &
 
858
.De
 
859
.TP
 
860
.BR dns:SRV-query \ (bool)
 
861
query for SRV records and use them before gethostbyname. The SRV records
 
862
are only used if port is not explicitly specified. See RFC2052 for details.
 
863
.TP
 
864
.BR dns:cache-enable \ (bool)
 
865
enable DNS cache. If it is off, lftp resolves host name each time it reconnects.
 
866
.TP
 
867
.BR dns:cache-expire " (time interval)"
 
868
time to live for DNS cache entries. It has format <number><unit>+, e.g.
 
869
1d12h30m5s or just 36h. To disable expiration, set it to `inf' or `never'.
 
870
.TP
 
871
.BR dns:cache-size \ (number)
 
872
maximum number of DNS cache entries.
 
873
.TP
 
874
.BR dns:fatal-timeout \ (seconds)
 
875
limit the time for DNS queries. If DNS server is unavailable too long, lftp
 
876
will fail to resolve a given host name. 0 means unlimited, the default.
 
877
.TP
 
878
.BR dns:order " (list of protocol names)"
 
879
sets the order of DNS queries. Default is ``inet inet6'' which means first
 
880
look up address in inet family, then inet6 and use first matched.
 
881
.TP
 
882
.BR dns:use-fork \ (bool)
 
883
if true, lftp will fork before resolving host address. Default is true.
 
884
.TP
 
885
.BR file:charset \ (string)
 
886
local character set. It is set from current locale initially.
 
887
.TP
 
888
.BR fish:connect-program \ (string)
 
889
the program to use for connecting to remote server. It should support `-l' option
 
890
for user name, `-p' for port number. Default is `ssh -ax'. You can set it to
 
891
`rsh', for example.
 
892
.TP
 
893
.BR fish:shell \ (string)
 
894
use specified shell on server side. Default is /bin/sh. On some systems,
 
895
/bin/sh exits when doing cd to a non-existent directory. lftp can handle
 
896
that but it has to reconnect. Set it to /bin/bash for such systems if
 
897
bash is installed.
 
898
.TP
 
899
.BR ftp:acct \ (string)
 
900
Send this string in ACCT command after login. The result is ignored.
 
901
The closure for this setting has format \fIuser@host\fP.
 
902
.TP
 
903
.BR ftp:anon-pass \ (string)
 
904
sets the password used for anonymous ftp access authentication.
 
905
Default is "-name@", where name is the username of the user running the
 
906
program.
 
907
.TP
 
908
.BR ftp:anon-user \ (string)
 
909
sets the user name used for anonymous ftp access authentication.
 
910
Default is "anonymous".
 
911
.TP
 
912
.BR ftp:auto-sync-mode \ (regex)
 
913
if first server message metches this regex, turn on sync mode for that host.
 
914
.TP
 
915
.BR ftp:charset \ (string)
 
916
the character set used by ftp server in requests, replies and file listings.
 
917
Default is empty which means the same as local. This setting is only used
 
918
when the server does not support UTF8.
 
919
.TP
 
920
.BR ftp:client \ (string)
 
921
the name of ftp client to send with CLNT command, if supported by server.
 
922
If it is empty, then no CLNT command will be sent.
 
923
.TP
 
924
.BR ftp:bind-data-socket \ (bool)
 
925
bind data socket to the interface of control connection (in passive mode).
 
926
Default is true, exception is the loopback interface.
 
927
.TP
 
928
.BR ftp:fix-pasv-address \ (bool)
 
929
if true, lftp will try to correct address returned by server for PASV command
 
930
in case when server address is in public network and PASV returns an address
 
931
from a private network. In this case lftp would substitute server address
 
932
instead of the one returned by PASV command, port number would not be changed.
 
933
Default is true.
 
934
.TP
 
935
.BR ftp:fxp-passive-source \ (bool)
 
936
if true, lftp will try to set up source ftp server in passive mode first,
 
937
otherwise destination one. If first attempt fails, lftp tries to set them up
 
938
the other way. If the other disposition fails too, lftp falls back to plain
 
939
copy. See also ftp:use-fxp.
 
940
.TP
 
941
.BR ftp:home \ (string)
 
942
Initial directory. Default is empty string which means auto. Set this to `/'
 
943
if you don't like the look of %2F in ftp URLs. The closure for this setting
 
944
has format \fIuser@host\fP.
 
945
.TP
 
946
.BR ftp:list-empty-ok \ (bool)
 
947
if set to false, empty lists from LIST command will be treated as incorrect,
 
948
and another method (NLST) will be used.
 
949
.TP
 
950
.BR ftp:list-options \ (string)
 
951
sets options which are always appended to LIST command. It can be
 
952
useful to set this to `-a' if server does not show dot (hidden) files by default.
 
953
Default is empty.
 
954
.TP
 
955
.BR ftp:nop-interval \ (seconds)
 
956
delay between NOOP commands when downloading tail of a file. This is useful
 
957
for ftp servers which send "Transfer complete" message before flushing
 
958
data transfer. In such cases NOOP commands can prevent connection timeout.
 
959
.TP
 
960
.BR ftp:passive-mode \ (bool)
 
961
sets passive ftp mode. This can be useful if you are behind a firewall or a
 
962
dumb masquerading router. In passive mode lftp uses PASV command, not the
 
963
PORT command which is used in active mode. In passive mode lftp itself
 
964
makes the data connection to the server; in active mode the server connects
 
965
to lftp for data transfer. Passive mode is the default.
 
966
.TP
 
967
.BR ftp:port-ipv4 " (ipv4 address)"
 
968
specifies an IPv4 address to send with PORT command. Default is empty which
 
969
means to send the address of local end of control connection.
 
970
.TP
 
971
.BR ftp:port-range \ (from-to)
 
972
allowed port range for active mode.
 
973
Format is min-max, or `full' or `any' to indicate any port. Default is `full'.
 
974
.TP
 
975
.BR ftp:proxy \ (URL)
 
976
specifies ftp proxy to use.
 
977
To disable proxy set this to empty string. Note that it is an ftp proxy which
 
978
uses ftp protocol, not ftp over http. Default value is taken from environment
 
979
variable \fBftp_proxy\fP if it starts with ``ftp://''. If your ftp proxy
 
980
requires authentication, specify user name and password in the URL.
 
981
.PP
 
982
If ftp:proxy starts with http://, hftp (ftp over http proxy) is used instead
 
983
of ftp automatically.
 
984
.TP
 
985
.BR ftp:rest-list \ (bool)
 
986
allow usage of REST command before LIST command. This might be useful for
 
987
large directories, but some ftp servers silently ignore REST before LIST.
 
988
.TP
 
989
.BR ftp:rest-stor \ (bool)
 
990
if false, lftp will not try to use REST before STOR. This can be useful
 
991
for some buggy servers which corrupt (fill with zeros) the file if REST followed
 
992
by STOR is used.
 
993
.TP
 
994
.BR ftp:retry-530 \ (regex)
 
995
Retry on server reply 530 for PASS command if text matches this regular expression.
 
996
This setting should be useful to distinguish between overloaded server
 
997
(temporary condition) and incorrect password (permanent condition).
 
998
.TP
 
999
.BR ftp:retry-530-anonymous \ (regex)
 
1000
Additional regular expression for anonymous login, like ftp:retry-530.
 
1001
.TP
 
1002
.BR ftp:site-group \ (string)
 
1003
Send this string in SITE GROUP command after login. The result is ignored.
 
1004
The closure for this setting has format \fIuser@host\fP.
 
1005
.TP
 
1006
.BR ftp:skey-allow \ (bool)
 
1007
allow sending skey/opie reply if server appears to support it. On by default.
 
1008
.TP
 
1009
.BR ftp:skey-force \ (bool)
 
1010
do not send plain text password over the network, use skey/opie instead. If
 
1011
skey/opie is not available, assume failed login. Off by default.
 
1012
.TP
 
1013
.BR ftp:ssl-allow \ (bool)
 
1014
if true, try to negotiate SSL connection with ftp server for non-anonymous
 
1015
access. Default is true. This setting is only available if lftp was compiled
 
1016
with openssl.
 
1017
.TP
 
1018
.BR ftp:ssl-force \ (bool)
 
1019
if trus, refuse to send password in clear when server does not support SSL.
 
1020
Default is false. This setting is only available if lftp was compiled with
 
1021
openssl.
 
1022
.TP
 
1023
.BR ftp:ssl-protect-data \ (bool)
 
1024
if true, request ssl connection for data transfers. This is cpu-intensive
 
1025
but provides privacy. Default is false. This setting is only available if
 
1026
lftp was compiled with openssl.
 
1027
.TP
 
1028
.BR ftp:ssl-protect-fxp \ (bool)
 
1029
if true, request ssl connection for data transfer between two ftp servers
 
1030
in FXP mode. CPSV or SSCN command will be used in that case. If ssl connection
 
1031
fails for some reason, lftp would try unprotected FXP transfer unless
 
1032
ftp:ssl-force is set for any of the two servers. Default is false.
 
1033
.TP
 
1034
.BR ftp:ssl-protect-list \ (bool)
 
1035
if true, request ssl connection for file list transfers. Default is true.
 
1036
.TP
 
1037
.BR ftp:stat-interval \ (seconds)
 
1038
interval between STAT commands. Default is 1.
 
1039
.TP
 
1040
.BR ftp:sync-mode \ (bool)
 
1041
if true, lftp will send one command at a time and wait for
 
1042
response. This might be useful if you are using a buggy ftp server or
 
1043
router. When it is off, lftp sends a pack of commands and waits for
 
1044
responses - it speeds up operation when round trip time is significant.
 
1045
Unfortunately it does not work with all ftp servers and some routers have
 
1046
troubles with it, so it is on by default.
 
1047
.TP
 
1048
.BR ftp:timezone \ (string)
 
1049
Assume this timezone for time in listings returned by LIST command.
 
1050
This setting can be GMT offset [+|-]HH[:MM[:SS]] or any valid TZ value
 
1051
(e.g. Europe/Moscow or MSK-3MSD,M3.5.0,M10.5.0/3). The default is GMT.
 
1052
Set it to an empty value to assume local timezone specified by environment
 
1053
variable TZ.
 
1054
.TP
 
1055
.BR ftp:use-abor \ (bool)
 
1056
if false, lftp does not send ABOR command but closes data connection
 
1057
immediately.
 
1058
.TP
 
1059
.BR ftp:use-feat \ (bool)
 
1060
when true (default), lftp uses FEAT command to determine extended features of
 
1061
ftp server.
 
1062
.TP
 
1063
.BR ftp:use-fxp \ (bool)
 
1064
if true, lftp will try to set up direct connection between two ftp servers.
 
1065
.TP
 
1066
.BR ftp:use-hftp \ (bool)
 
1067
when ftp:proxy points to an http proxy, this setting selects hftp method (GET,
 
1068
HEAD) when true, and CONNECT method when false. Default is true.
 
1069
.TP
 
1070
.BR ftp:lang \ (bool)
 
1071
the language selected with LANG command, if supported as indicated by FEAT
 
1072
response. Default is empty which means server default.
 
1073
.TP
 
1074
.BR ftp:use-mdtm \ (bool)
 
1075
when true (default), lftp uses MDTM command to determine file modification
 
1076
time.
 
1077
.TP
 
1078
.BR ftp:use-mdtm-overloaded \ (bool)
 
1079
when true, lftp uses two argument MDTM command to set file modification
 
1080
time on uploaded files. Default is false.
 
1081
.TP
 
1082
.BR ftp:use-site-idle \ (bool)
 
1083
when true, lftp sends `SITE IDLE' command with net:idle argument. Default
 
1084
is false.
 
1085
.TP
 
1086
.BR ftp:use-site-utime \ (bool)
 
1087
when true, lftp sends `SITE UTIME' command to set file modification time
 
1088
on uploaded files. Default is true.
 
1089
.TP
 
1090
.BR ftp:use-size \ (bool)
 
1091
when true (default), lftp uses SIZE command to determine file size.
 
1092
.TP
 
1093
.BR ftp:use-stat \ (bool)
 
1094
if true, lftp sends STAT command in FXP mode transfer to know how much
 
1095
data has been transferred. See also ftp:stat-interval. Default is true.
 
1096
.TP
 
1097
.BR ftp:use-telnet-iac \ (bool)
 
1098
when true (default), lftp uses TELNET IAC command and follows TELNET protocol
 
1099
as specified in RFC959. When false, it does not follow TELNET protocol and
 
1100
thus does not double 255 (0xFF, 0377) character and does not prefix ABOR and
 
1101
STAT commands with TELNET IP+SYNCH signal.
 
1102
.TP
 
1103
.BR ftp:use-quit " (bool)"
 
1104
if true, lftp sends QUIT before disconnecting from ftp server. Default is true.
 
1105
.TP
 
1106
.BR ftp:verify-address \ (bool)
 
1107
verify that data connection comes from the network address of control
 
1108
connection peer. This can possibly prevent data connection spoofing
 
1109
which can lead to data corruption. Unfortunately, this can fail
 
1110
for sertain ftp servers with several network interfaces,
 
1111
when they do not set outgoing address on data socket, so it is disabled by default.
 
1112
.TP
 
1113
.BR ftp:verify-port \ (bool)
 
1114
verify that data connection has port 20 (ftp-data) on its remote end.
 
1115
This can possibly prevent data connection spoofing by users of remote
 
1116
host. Unfortunately, too many windows and even unix ftp servers forget
 
1117
to set proper port on data connection, thus this check is off by default.
 
1118
.TP
 
1119
.BR ftp:web-mode \ (bool)
 
1120
disconnect after closing data connection. This can be useful for totally
 
1121
broken ftp servers. Default is false.
 
1122
.TP
 
1123
.BR hftp:cache \ (bool)
 
1124
allow server/proxy side caching for ftp-over-http protocol.
 
1125
.TP
 
1126
.BR hftp:proxy \ (URL)
 
1127
specifies http proxy for ftp-over-http protocol (hftp). The protocol hftp
 
1128
cannot work without a http proxy, obviously.
 
1129
Default value is taken from environment
 
1130
variable \fBftp_proxy\fP if it starts with ``http://'', otherwise from
 
1131
environment variable \fBhttp_proxy\fP.  If your ftp proxy
 
1132
requires authentication, specify user name and password in the URL.
 
1133
.TP
 
1134
.BR hftp:use-authorization \ (bool)
 
1135
if set to off, lftp will send password as part of URL to the proxy. This
 
1136
may be required for some proxies (e.g. M-soft). Default is on, and lftp
 
1137
will send password as part of Authorization header.
 
1138
.TP
 
1139
.BR hftp:use-head \ (bool)
 
1140
if set to off, lftp will try to use `GET' instead of `HEAD' for hftp protocol.
 
1141
While this is slower, it may allow lftp to work with some proxies which
 
1142
don't understand or mishandle ``HEAD ftp://'' requests.
 
1143
.TP
 
1144
.BR hftp:use-type \ (bool)
 
1145
If set to off, lftp won't try to append `;type=' to URLs passed to proxy.
 
1146
Some broken proxies don't handle it correctly. Default is on.
 
1147
.TP
 
1148
.BR "http:accept, http:accept-charset, http:accept-language" " (string)"
 
1149
specify corresponding HTTP request headers.
 
1150
.TP
 
1151
.BR http:cache \ (bool)
 
1152
allow server/proxy side caching.
 
1153
.TP
 
1154
.BR http:cookie \ (string)
 
1155
send this cookie to server. A closure is useful here:
 
1156
     set cookie/www.somehost.com "param=value"
 
1157
.TP
 
1158
.BR http:post-content-type " (string)"
 
1159
specifies value of Content-Type http request header for POST method.
 
1160
Default is ``application/x-www-form-urlencoded''.
 
1161
.TP
 
1162
.BR http:proxy \ (URL)
 
1163
specifies http proxy. It is used when lftp works over http protocol.
 
1164
Default value is taken from environment variable \fBhttp_proxy\fP.
 
1165
If your proxy requires authentication, specify user name and password
 
1166
in the URL.
 
1167
.TP
 
1168
.BR http:put-method " (PUT or POST)"
 
1169
specifies which http method to use on put.
 
1170
.TP
 
1171
.BR http:put-content-type " (string)"
 
1172
specifies value of Content-Type http request header for PUT method.
 
1173
.TP
 
1174
.BR http:referer " (string)"
 
1175
specifies value for Referer http request header. Single dot `.' expands
 
1176
to current directory URL. Default is `.'. Set to empty string to disable
 
1177
Referer header.
 
1178
.TP
 
1179
.BR http:set-cookies " (boolean)"
 
1180
if true, lftp modifies http:cookie variables when Set-Cookie header is received.
 
1181
.TP
 
1182
.BR http:user-agent " (string)"
 
1183
the string lftp sends in User-Agent header of HTTP request.
 
1184
.TP
 
1185
.BR https:proxy " (string)"
 
1186
specifies https proxy. Default value is taken from environment variable \fBhttps_proxy\fP.
 
1187
.TP
 
1188
.BR mirror:exclude-regex " (regex)"
 
1189
specifies default exclusion pattern. You can override it by --include option.
 
1190
.TP
 
1191
.BR mirror:order " (list of patterns)"
 
1192
specifies order of file transfers. E.g. setting this to "*.sfv *.sum" makes mirror to
 
1193
transfer files matching *.sfv first, then ones matching *.sum and then all other
 
1194
files. To process directories after other files, add "*/" to end of pattern list.
 
1195
.TP
 
1196
.BR mirror:parallel-directories " (boolean)"
 
1197
if true, mirror will start processing of several directories in parallel
 
1198
when it is in parallel mode. Otherwise, it will transfer files from a single
 
1199
directory before moving to other directories.
 
1200
.TP
 
1201
.BR mirror:parallel-transfer-count " (number)"
 
1202
specifies number of parallel transfers mirror is allowed to start. Default is 1.
 
1203
You can override it with --parallel option.
 
1204
.TP
 
1205
.BR mirror:use-pget-n " (number)"
 
1206
specifies -n option for pget command used to transfer every single file under
 
1207
mirror. Default is 1 which disables pget.
 
1208
.TP
 
1209
.BR module:path \ (string)
 
1210
colon separated list of directories to look for modules. Can be initialized by
 
1211
environment variable LFTP_MODULE_PATH. Default is `PKGLIBDIR/VERSION:PKGLIBDIR'.
 
1212
.TP
 
1213
.BR net:connection-limit \ (number)
 
1214
maximum number of concurrent connections to the same site. 0 means unlimited.
 
1215
.TP
 
1216
.BR net:connection-takeover \ (bool)
 
1217
if true, foreground connections have priority over background ones and can
 
1218
interrupt background transfers to complete a foreground operation.
 
1219
.TP
 
1220
.BR net:idle \ (seconds)
 
1221
disconnect from server after that number of idle seconds.
 
1222
.TP
 
1223
.BR net:limit-rate " (bytes per second)"
 
1224
limit transfer rate on data connection. 0 means unlimited. You can specify
 
1225
two numbers separated by colon to limit download and upload rate separately.
 
1226
.TP
 
1227
.BR net:limit-max \ (bytes)
 
1228
limit accumulating of unused limit-rate. 0 means unlimited.
 
1229
.TP
 
1230
.BR net:limit-total-rate " (bytes per second)"
 
1231
limit transfer rate of all connections in sum. 0 means unlimited. You can specify
 
1232
two numbers separated by colon to limit download and upload rate separately.
 
1233
Note that sockets have receive buffers on them, this can lead to network
 
1234
link load higher than this rate limit just after transfer beginning. You
 
1235
can try to set net:socket-buffer to relatively small value to avoid this.
 
1236
.TP
 
1237
.BR net:limit-total-max \ (bytes)
 
1238
limit accumulating of unused limit-total-rate. 0 means unlimited.
 
1239
.TP
 
1240
.BR net:max-retries \ (number)
 
1241
the maximum number of sequential retries of an operation without success.
 
1242
0 means unlimited.
 
1243
.TP
 
1244
.BR net:no-proxy \ (string)
 
1245
contains comma separated list of domains for which proxy should not be used.
 
1246
Default is taken from environment variable \fBno_proxy\fP.
 
1247
.TP
 
1248
.BR net:persist-retries " (number)"
 
1249
ignore this number of hard errors. Useful to login to buggy ftp servers which
 
1250
reply 5xx when there is too many users.
 
1251
.TP
 
1252
.BR net:reconnect-interval-base \ (seconds)
 
1253
sets the base minimal time between reconnects. Actual interval depends on
 
1254
net:reconnect-interval-multiplier and number of attempts to perform an
 
1255
operation.
 
1256
.TP
 
1257
.BR net:reconnect-interval-max \ (seconds)
 
1258
sets maximum reconnect interval. When current interval after multiplication
 
1259
by net:reconnect-interval-multiplier reachs this value (or exceeds it), it
 
1260
is reset back to net:reconnect-interval-base.
 
1261
.TP
 
1262
.BR net:reconnect-interval-multiplier \ (real\ number)
 
1263
sets multiplier by which base interval is multiplied each time new attempt
 
1264
to perform an operation fails. When the interval reachs maximum, it is reset
 
1265
to base value. See net:reconnect-interval-base and net:reconnect-interval-max.
 
1266
.TP
 
1267
.BR net:socket-bind-ipv4 " (ipv4 address)"
 
1268
bind all IPv4 sockets to specified address. This can be useful to select a
 
1269
specific network interface to use. Default is empty which means not to bind
 
1270
IPv4 sockets, operating system will choose an address automatically using
 
1271
routing table.
 
1272
.TP
 
1273
.BR net:socket-bind-ipv6 " (ipv6 address)"
 
1274
the same for IPv6 sockets.
 
1275
.TP
 
1276
.BR net:socket-buffer \ (bytes)
 
1277
use given size for SO_SNDBUF and SO_RCVBUF socket options. 0 means system
 
1278
default.
 
1279
.TP
 
1280
.BR net:socket-maxseg \ (bytes)
 
1281
use given size for TCP_MAXSEG socket option. Not all operating systems support
 
1282
this option, but linux does.
 
1283
.TP
 
1284
.BR net:timeout \ (seconds)
 
1285
sets the network protocol timeout.
 
1286
.TP
 
1287
.BR sftp:connect-program \ (string)
 
1288
the program to use for connecting to remote server. It should support `-l' option
 
1289
for user name, `-p' for port number. Default is `ssh -ax'. You can set it to
 
1290
`rsh', for example.
 
1291
.TP
 
1292
.BR sftp:max-packets-in-flight \ (number)
 
1293
The maximum number of unreplied packets in flight. If round trip time is
 
1294
significant, you should increase this and size-read/size-write. Default is 3.
 
1295
.TP
 
1296
.BR sftp:protocol-version \ (number)
 
1297
The protocol number to negotiate. Default is 4. The actual protocol version
 
1298
used depends on server.
 
1299
.TP
 
1300
.BR sftp:server-program \ (string)
 
1301
The server program implementing SFTP protocol. If it does not contain a slash `/',
 
1302
it is considered a ssh2 subsystem and -s option is used when starting connect-program.
 
1303
Default is `sftp'. You can use rsh as transport level protocol like this:
 
1304
.Ds
 
1305
set sftp:connect-program rsh
 
1306
set sftp:server-program /usr/libexec/openssh/sftp-server
 
1307
.De
 
1308
Similarly you can run sftp over ssh1.
 
1309
.TP
 
1310
.BR sftp:size-read \ (number)
 
1311
Block size for reading. Default is 0x8000.
 
1312
.TP
 
1313
.BR sftp:size-write \ (number)
 
1314
Block size for writing. Default is 0x8000.
 
1315
.TP
 
1316
.BR ssl:ca-file " (path to file)"
 
1317
use specified file as Certificate Authority certificate.
 
1318
.TP
 
1319
.BR ssl:ca-path " (path to directory)"
 
1320
use specified directory as Certificate Authority certificate repository.
 
1321
.TP
 
1322
.BR ssl:crl-file " (path to file)"
 
1323
use specified file as Certificate Revocation List certificate.
 
1324
.TP
 
1325
.BR ssl:crl-path " (path to directory)"
 
1326
use specified directory as Certificate Revocation List certificate repository.
 
1327
.TP
 
1328
.BR ssl:key-file " (path to file)"
 
1329
use specified file as your private key.
 
1330
.TP
 
1331
.BR ssl:cert-file " (path to file)"
 
1332
use specified file as your certificate.
 
1333
.TP
 
1334
.BR ssl:verify-certificate \ (boolean)
 
1335
if set to yes, then verify server's certificate to be signed by a known
 
1336
Certificate Authority and not be on Certificate Revocation List.
 
1337
.TP
 
1338
.BR xfer:clobber \ (bool)
 
1339
if this setting is off, get commands will not overwrite existing
 
1340
files and generate an error instead. Default is on.
 
1341
.TP
 
1342
.BR xfer:eta-period \ (seconds)
 
1343
the period over which wheighted average rate is calculated to produce ETA.
 
1344
.TP
 
1345
.BR xfer:eta-terse \ (bool)
 
1346
show terse ETA (only high order parts). Default is true.
 
1347
.TP
 
1348
.BR xfer:max-redirections " (number)"
 
1349
maximum number of redirections. This can be useful for downloading over HTTP.
 
1350
Default is 0, which prohibits redirections.
 
1351
.TP
 
1352
.BR xfer:rate-period \ (seconds)
 
1353
the period over which wheighted average rate is calculated to be shown.
 
1354
 
 
1355
.PP
 
1356
The name of variables can be abbreviated unless it becomes
 
1357
ambiguous. The prefix before `:' can be omitted too. You can
 
1358
set one variable several times for different closures, and thus
 
1359
you can get a particular settings for particular state. The closure
 
1360
is to be specified after variable name separated with slash `/'.
 
1361
.PP
 
1362
The closure for `dns:', `net:', `ftp:', `http:', `hftp:' domain variables
 
1363
is currently just the host name as you specify it in the `open' command
 
1364
(with some exceptions where closure is meaningless, e.g. dns:cache-size).
 
1365
For some `cmd:' domain variables the closure is current URL without path.
 
1366
For other variables it is not currently used. See examples in the sample
 
1367
.IR lftp.conf .
 
1368
.PP
 
1369
Certain commands and settings take a time interval parameter. It has
 
1370
the format Nx[Nx...], where N is time amount and x is time unit: d - days,
 
1371
h - hours, m - minutes, s - seconds. Default unit is second. E.g. 5h30m.
 
1372
Also the interval can be `infinity', `inf', `never', `forever' - it means
 
1373
infinite interval. E.g. `sleep forever' or `set dns:cache-expire never'.
 
1374
 
 
1375
.SS FTP asynchronous mode (pipelining)
 
1376
.PP
 
1377
.B Lftp
 
1378
can speed up ftp operations by sending several commands at once and
 
1379
then checking all the responses. See ftp:sync-mode variable. Sometimes
 
1380
this does not work, thus synchronous mode is the default. You can try
 
1381
to turn synchronous mode off and see if it works for you. It is known
 
1382
that some network software dealing with address translation works
 
1383
incorrectly in the case of several FTP commands in one network packet.
 
1384
.PP
 
1385
RFC959 says: ``The user-process sending another command before the
 
1386
completion reply would be in violation of protocol; but server-FTP
 
1387
processes should queue any commands that arrive while a preceding
 
1388
command is in progress''. Also, RFC1123 says: ``Implementors MUST
 
1389
NOT assume any correspondence between READ boundaries on the control
 
1390
connection and the Telnet EOL sequences (CR LF).'' and ``a single READ
 
1391
from the control connection may include more than one FTP command''.
 
1392
 
 
1393
So it must be safe to send several commands at once, which speeds up
 
1394
operation a lot and seems to work with all Unix and VMS based ftp
 
1395
servers. Unfortunately, windows based servers often cannot handle
 
1396
several commands in one packet, and so cannot some broken routers.
 
1397
 
 
1398
.SH OPTIONS
 
1399
.TP
 
1400
.B \-d
 
1401
Switch on debugging mode
 
1402
.TP
 
1403
.BI \-e " commands"
 
1404
Execute given commands and don't exit.
 
1405
.TP
 
1406
.BI \-p " port"
 
1407
Use the given port to connect
 
1408
.TP
 
1409
.BI \-u " user\fR[\fP\fB,\fPpass\fR]\fP"
 
1410
Use the given username and password to connect
 
1411
.TP
 
1412
.BI \-f " script_file"
 
1413
Execute commands in the file and exit
 
1414
.TP
 
1415
.BI \-c " commands"
 
1416
Execute the given commands and exit
 
1417
 
 
1418
.SH ENVIRONMENT VARIABLES
 
1419
The following environment variables are processed by \fBlftp\fR:
 
1420
.IP "\fBHOME\fP"
 
1421
Used for (local) tilde (`~') expansion
 
1422
.IP "\fBSHELL\fP"
 
1423
Used by the \fB!\fR command to determine the shell to run.
 
1424
.IP "\fBPAGER\fP"
 
1425
This should be the name of the pager to use.  It's used by the
 
1426
\fBmore\fR and \fBzmore\fR commands.
 
1427
.IP "\fBhttp_proxy\fP, \fBhttps_proxy\fP"
 
1428
Used to set initial http:proxy, hftp:proxy and https:proxy variables.
 
1429
.IP "\fBftp_proxy\fP"
 
1430
Used to set initial ftp:proxy or hftp:proxy variables, depending
 
1431
on URL protocol used in this environment variable.
 
1432
.IP "\fBno_proxy\fP"
 
1433
Used to set initial net:no-proxy variable.
 
1434
.IP "\fBLFTP_MODULE_PATH\fP"
 
1435
Used to set initial module:path variable.
 
1436
 
 
1437
.SH FILES
 
1438
.TP
 
1439
.I "/etc/lftp.conf"
 
1440
system-wide startup file. Actual location depends on \-\-sysconfdir
 
1441
configure option. It is \fI/etc\fR when prefix is \fI/usr\fR,
 
1442
\fI/usr/local/etc\fR by default.
 
1443
 
 
1444
.TP
 
1445
.I "~/.lftp/rc," "~/.lftprc"
 
1446
These files are executed on lftp startup after \fI/etc/lftp.conf\fR.
 
1447
.TP
 
1448
.I "~/.lftp/log"
 
1449
The file things are logged to when lftp moves into the background in
 
1450
nohup mode.
 
1451
.TP
 
1452
.I "~/.lftp/bookmarks"
 
1453
The file is used to store lftp's bookmarks.  See the \fBbookmark\fR
 
1454
command.
 
1455
.TP
 
1456
.I "~/.lftp/cwd_history"
 
1457
The file is used to store last working directories for each site visited.
 
1458
.TP
 
1459
.I "~/.netrc"
 
1460
The file is consulted to get default login and password to ftp server.
 
1461
Passwords are also searched here if an URL with user name but with no
 
1462
password is used.
 
1463
 
 
1464
.SH SEE ALSO
 
1465
.BR ftpd "(8), " ftp (1)
 
1466
.br
 
1467
RFC854 (telnet),
 
1468
RFC959 (ftp),
 
1469
RFC1123,
 
1470
RFC1945 (http/1.0),
 
1471
RFC2052 (SRV RR),
 
1472
RFC2068 (http/1.1),
 
1473
RFC2228 (ftp security extensions),
 
1474
RFC2389 (ftp FEAT),
 
1475
RFC2428 (ftp/ipv6),
 
1476
RFC2640 (ftp i18n).
 
1477
.br
 
1478
.na
 
1479
http://www.ietf.org/internet-drafts/draft-murray-auth-ftp-ssl-11.txt
 
1480
(ftp over ssl),
 
1481
.br
 
1482
http://www.ietf.org/internet-drafts/draft-ietf-ftpext-mlst-16.txt
 
1483
(ftp extensions over RFC959),
 
1484
.br
 
1485
http://www.ietf.org/internet-drafts/draft-ietf-secsh-filexfer-04.txt
 
1486
(sftp).
 
1487
.ad
 
1488
 
 
1489
.SH AUTHOR
 
1490
.nf
 
1491
Alexander V. Lukyanov
 
1492
lav@yars.free.net
 
1493
.fi
 
1494
 
 
1495
.SH ACKNOWLEDGMENTS
 
1496
This manual page was originally written by Christoph Lameter
 
1497
<clameter@debian.org>, for the Debian GNU/Linux system.
 
1498
The page was improved by Nicolas Lichtmaier <nick@Feedback.com.ar>,
 
1499
James Troup <J.J.Troup@comp.brad.ac.uk> and
 
1500
Alexander V. Lukyanov <lav@yars.free.net>.