2
.\" lftp.1 - Sophisticated ftp program
4
.\" This file is part of lftp.
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.
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.
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.
20
.\" $Id: lftp.1,v 1.92 2004/05/24 15:16:36 lav Exp $
23
.\" Sp space down the interparagraph distance
29
.\" Ds begin a display, indented .5 inches from the surrounding text.
31
.\" Note that uses of Ds and De may NOT be nested.
39
.\" De end a display (no trailing vertical spacing)
45
.TH lftp 1 "18 May 2004"
47
lftp \- Sophisticated file transfer program
50
[\fB\-d\fR] [\fB\-e \fIcmd\fR] [\fB\-p \fIport\fR]
51
[\fB\-u \fIuser\fR[\fB,\fIpass\fR]] [\fIsite\fR]
53
.BI "lftp \-f " script_file
55
.BI "lftp \-c " commands
62
This man page documents lftp version 3.0.4.
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
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.
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.
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 (&&, ||).
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.
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.
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.
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
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.
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/)
126
.BI ! " shell command"
128
Launch shell or shell command.
134
To do a directory listing of the local host.
137
.RI " [" name " [" value ]]
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.
150
Sets the user to anonymous. This is the default.
152
.BR at " \fItime\fP [ -- \fIcommand\fP ] "
154
Wait until the given time and execute given (optional) command. See also at(1).
157
.RI " [" subcommand ]
159
The bookmark command controls bookmarks.
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)
170
.RI " [" subcommand ]
172
The cache command controls local memory cache.
173
The following subcommands are recognized:
175
stat print cache status (default)
176
on|off turn on/off caching
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)
184
.BR cat " \fIfiles\fP"
186
cat outputs the remote file(s) to stdout. (See also \fBmore\fR,
187
\fBzcat\fR and \fBzmore\fR)
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.
196
.BR chmod " \fImode files\fP"
198
Change permission mask on remote files. The mode must be an octal number.
200
.BR close " [" -a "]"
202
Close idle connections. By default only with the current server, use
203
-a to close all idle connections.
205
.BR command " \fIcmd args...\fP
207
execute given command ignoring aliases.
210
.IR file "] " level "|\fBoff\fP"
212
Switch debugging to \fIlevel\fP or turn it off. Use -o to redirect
213
the debug output to a file.
215
.BR echo " [" -n "] \fIstring\fR"
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
228
`exit bg' forces moving to background when cmd:move-background is false.
235
.RI " [" directory "] "
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
243
Obsolete. Use one of the following instead:
245
get ftp://... -o ftp://...
246
get -O ftp://... file1 file2...
249
mget -O ftp://... ftp://.../*
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.
256
.RB [ -a "] [" -c "] [" -O
257
.RB "\fIbase\fP] \fIrfile\fP [" -o " \fIlfile\fP] ..."
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
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
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)
282
.RI [ OPTS "] " rfile
284
Transfer a single file. Options:
286
-o <lfile> destination file name (default - basename of rfile)
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
296
.BR glob " [" -d "] [" -a "]"
297
.RB "[" -f "] \fIcommand patterns\fP"
299
Glob given patterns containing metacharacters and pass result to given command.
300
E.g. ``glob echo *''.
302
-f plain files (default)
310
Print help for \fIcmd\fP or if no \fIcmd\fP was specified print a list of
316
List running jobs. -v means verbose, several -v can be specified.
321
Delete specified job with \fIjob_no\fP or all jobs.
322
(For \fIjob_no\fP see \fBjobs\fP)
327
Change current local directory \fIldir\fP. The previous local
328
directory is stored as `-'. You can do `lcd -' to change the directory back.
332
Print current working directory on local machine.
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
344
.BR mget " [" -c "] [" -d "]"
345
.RB [ -a "] [" -E "]"
346
.RB [ -O " \fIbase\fP] \fIfiles\fP"
348
Gets selected files with expanded wildcards.
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
360
.RI [ OPTS "] [" source
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.
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
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.
402
\fIRX\fP is an extended regular expression, just like in
405
\fIGP\fP is a glob pattern, e.g. `*.zip'.
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.
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).
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.
420
Verbosity level can be selected using \-\-verbose=level option or by several
421
\-v options, e.g. \-vvv. Levels are:
423
0 - no output (default)
425
2 - +print not deleted file names (when -e is not specified)
426
3 - +print directory names which are mirrored
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.
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.
436
.RB "[" -p "] " \fIdir(s)\fP
438
Make remote directories. If -p is used, make all components of paths.
441
.IR "module " [ " args " ]
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
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)
454
.BR mput " [" -c "] [" -d "]"
455
.RB [ -a "] [" -E "]"
456
.RB [ -O " \fIbase\fP] \fIfiles\fP"
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.
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
472
Same as `glob rm'. Removes specified file(s) with wildcard expansion.
475
\fIfile1\fP \fIfile2\fP
477
Rename \fIfile1\fP to \fIfile2\fP.
482
List remote file names
485
.RB [ -e " \fIcmd\fP]"
486
.BR "[" -u " \fIuser\fP[", "\fIpass\fP]]"
487
.BR "[" -p " \fIport\fP] \fIhost\fP|\fIurl\fP"
489
Select an ftp server.
492
.RI [ OPTS "] " rfile " [" "\fB-o\fP lfile"
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
500
-n \fImaxconn\fP set maximum number of connections (default 5)
505
.RB [ -a "] [" -c "]"
506
.RB "[" -O " \fIbase\fP] \fIlfile\fP [" -o \fIrfile\fP]
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.
511
-o <rfile> specifies remote file name (default - basename of lfile)
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
521
Print current remote directory.
524
.RB [ -n " \fInum\fP ] \fIcmd\fP"
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
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.
539
`queue' with no arguments will either create a stopped queue or print queue
543
.BR "--delete|-d " "[\fIindex or wildcard expression\fP]"
545
Delete one or more items from the queue. If no argument is given, the last
546
entry in the queue is deleted.
549
.BR "--move|-m " "<\fIindex or wildcard expression\fP> [\fIindex\fP]"
551
Move the given items before the given queue index, or to the end if no
552
destination is given.
557
-Q Output in a format that can be used to re-queue.
558
Useful with --delete.
565
> queue get another_file
567
> queue get yet_another_file
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".
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.
586
For HTTP - specific to HTTP action. Syntax: ``quote <command> [<args>]''.
587
Command may be ``set-cookie'' or ``post''.
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
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.
600
quote find -name \*.zip
603
.BR "reget \fIrfile\fP " [ -o " \fIlfile\fP]"
610
Same as `ls', but ignores the cache.
615
Same as `nlist', but ignores the cache.
617
.BR repeat " [\fIdelay\fP] [\fIcommand\fP]"
619
Repeat the command. Between the commands a delay inserted, by default 1 second.
622
repeat at tomorrow -- mirror
626
.BR reput " \fIlfile\fP [" -o " \fIrfile\fP]"
630
.BR rm " [" -r "] [" -f ]
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.
640
Remove remote directories.
645
List cached sessions or switch to specified session.
648
[\fIvar\fP [\fIval\fP]]
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:
657
-a list all settings, including default values
658
-d list only default values, not necessary current ones
665
Execute site command \fIsite_cmd\fP and output the result.
666
You can redirect its output.
668
.BR sleep " \fIinterval\fP "
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.
674
.BR slot " [\fIname\fP]"
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.
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).
690
Execute commands recorded in file \fIfile\fP or returned by specified external command.
698
Stop lftp process. Note that transfers will be also stopped until you
699
continue the process with shell's fg or bg commands.
702
\fIuser\fP [\fIpass\fP]
705
\fIURL\fP [\fIpass\fP]
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.
712
Print \fBlftp\fR version.
719
Wait for specified job to terminate. If jobno is omitted, wait for last
722
`wait all' waits for all jobs termination.
727
Same as cat, but filter each file through zcat. (See also \fBcat\fR,
728
\fBmore\fR and \fBzmore\fR)
733
Same as more, but filter each file through zcat. (See also \fBcat\fR,
734
\fBzcat\fR and \fBmore\fR)
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.
744
There is also a system-wide startup file in
746
It can be in different directory, see FILES section.
749
has the following settable variables (you can also use
750
`set -a' to see all variables and their values):
752
.BR bmk:save-passwords \ (bool)
753
save plain text passwords in ~/.lftp/bookmarks on `bookmark add' command.
756
.BR cmd:at-exit \ (string)
757
the commands in string are executed before lftp exits.
759
.BR cmd:csh-history \ (bool)
760
enables csh-like history expansion.
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'.
766
.BR cmd:fail-exit \ (bool)
767
if true, exit when an unconditional (without || and && at begin) command fails.
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
774
.BR cmd:ls-default \ (string)
777
.BR cmd:move-background " (boolean)"
778
when false, lftp refuses to go to background when exiting. To force it, use `exit bg'.
780
.BR cmd:prompt \ (string)
781
The prompt. lftp recognizes the following backslash-escaped special
782
characters that are decoded as follows:
788
insert @ if current user is not default
791
an ASCII bell character (07)
794
an ASCII escape character (033)
797
the hostname you are connected to
803
the name of the client (lftp)
809
the username of the user you are logged in as
812
the URL of the remote site (e.g., ftp://g437.ub.gu.se/home/james/src/lftp)
815
the version of \fBlftp\fP (e.g., 2.0.3)
818
the current working directory at the remote site
821
the base name of the current working directory at the remote site
824
the character corresponding to the octal number \fInnn\fP
830
skips next character if previous substitution was empty.
833
begin a sequence of non-printing characters, which could be used to
834
embed a terminal control sequence into the prompt
837
end a sequence of non-printing characters
842
.BR cmd:remote-completion \ (bool)
843
a boolean to control whether or not lftp uses remote completion.
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.
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.
856
set cmd:verify-path/hftp://* false
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.
864
.BR dns:cache-enable \ (bool)
865
enable DNS cache. If it is off, lftp resolves host name each time it reconnects.
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'.
871
.BR dns:cache-size \ (number)
872
maximum number of DNS cache entries.
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.
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.
882
.BR dns:use-fork \ (bool)
883
if true, lftp will fork before resolving host address. Default is true.
885
.BR file:charset \ (string)
886
local character set. It is set from current locale initially.
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
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
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.
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
908
.BR ftp:anon-user \ (string)
909
sets the user name used for anonymous ftp access authentication.
910
Default is "anonymous".
912
.BR ftp:auto-sync-mode \ (regex)
913
if first server message metches this regex, turn on sync mode for that host.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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'.
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.
982
If ftp:proxy starts with http://, hftp (ftp over http proxy) is used instead
983
of ftp automatically.
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.
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
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).
999
.BR ftp:retry-530-anonymous \ (regex)
1000
Additional regular expression for anonymous login, like ftp:retry-530.
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.
1006
.BR ftp:skey-allow \ (bool)
1007
allow sending skey/opie reply if server appears to support it. On by default.
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.
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
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
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.
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.
1034
.BR ftp:ssl-protect-list \ (bool)
1035
if true, request ssl connection for file list transfers. Default is true.
1037
.BR ftp:stat-interval \ (seconds)
1038
interval between STAT commands. Default is 1.
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.
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
1055
.BR ftp:use-abor \ (bool)
1056
if false, lftp does not send ABOR command but closes data connection
1059
.BR ftp:use-feat \ (bool)
1060
when true (default), lftp uses FEAT command to determine extended features of
1063
.BR ftp:use-fxp \ (bool)
1064
if true, lftp will try to set up direct connection between two ftp servers.
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.
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.
1074
.BR ftp:use-mdtm \ (bool)
1075
when true (default), lftp uses MDTM command to determine file modification
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.
1082
.BR ftp:use-site-idle \ (bool)
1083
when true, lftp sends `SITE IDLE' command with net:idle argument. Default
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.
1090
.BR ftp:use-size \ (bool)
1091
when true (default), lftp uses SIZE command to determine file size.
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.
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.
1103
.BR ftp:use-quit " (bool)"
1104
if true, lftp sends QUIT before disconnecting from ftp server. Default is true.
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.
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.
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.
1123
.BR hftp:cache \ (bool)
1124
allow server/proxy side caching for ftp-over-http protocol.
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.
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.
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.
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.
1148
.BR "http:accept, http:accept-charset, http:accept-language" " (string)"
1149
specify corresponding HTTP request headers.
1151
.BR http:cache \ (bool)
1152
allow server/proxy side caching.
1154
.BR http:cookie \ (string)
1155
send this cookie to server. A closure is useful here:
1156
set cookie/www.somehost.com "param=value"
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''.
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
1168
.BR http:put-method " (PUT or POST)"
1169
specifies which http method to use on put.
1171
.BR http:put-content-type " (string)"
1172
specifies value of Content-Type http request header for PUT method.
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
1179
.BR http:set-cookies " (boolean)"
1180
if true, lftp modifies http:cookie variables when Set-Cookie header is received.
1182
.BR http:user-agent " (string)"
1183
the string lftp sends in User-Agent header of HTTP request.
1185
.BR https:proxy " (string)"
1186
specifies https proxy. Default value is taken from environment variable \fBhttps_proxy\fP.
1188
.BR mirror:exclude-regex " (regex)"
1189
specifies default exclusion pattern. You can override it by --include option.
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.
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.
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.
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.
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'.
1213
.BR net:connection-limit \ (number)
1214
maximum number of concurrent connections to the same site. 0 means unlimited.
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.
1220
.BR net:idle \ (seconds)
1221
disconnect from server after that number of idle seconds.
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.
1227
.BR net:limit-max \ (bytes)
1228
limit accumulating of unused limit-rate. 0 means unlimited.
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.
1237
.BR net:limit-total-max \ (bytes)
1238
limit accumulating of unused limit-total-rate. 0 means unlimited.
1240
.BR net:max-retries \ (number)
1241
the maximum number of sequential retries of an operation without success.
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.
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.
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
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.
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.
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
1273
.BR net:socket-bind-ipv6 " (ipv6 address)"
1274
the same for IPv6 sockets.
1276
.BR net:socket-buffer \ (bytes)
1277
use given size for SO_SNDBUF and SO_RCVBUF socket options. 0 means system
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.
1284
.BR net:timeout \ (seconds)
1285
sets the network protocol timeout.
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
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.
1296
.BR sftp:protocol-version \ (number)
1297
The protocol number to negotiate. Default is 4. The actual protocol version
1298
used depends on server.
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:
1305
set sftp:connect-program rsh
1306
set sftp:server-program /usr/libexec/openssh/sftp-server
1308
Similarly you can run sftp over ssh1.
1310
.BR sftp:size-read \ (number)
1311
Block size for reading. Default is 0x8000.
1313
.BR sftp:size-write \ (number)
1314
Block size for writing. Default is 0x8000.
1316
.BR ssl:ca-file " (path to file)"
1317
use specified file as Certificate Authority certificate.
1319
.BR ssl:ca-path " (path to directory)"
1320
use specified directory as Certificate Authority certificate repository.
1322
.BR ssl:crl-file " (path to file)"
1323
use specified file as Certificate Revocation List certificate.
1325
.BR ssl:crl-path " (path to directory)"
1326
use specified directory as Certificate Revocation List certificate repository.
1328
.BR ssl:key-file " (path to file)"
1329
use specified file as your private key.
1331
.BR ssl:cert-file " (path to file)"
1332
use specified file as your certificate.
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.
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.
1342
.BR xfer:eta-period \ (seconds)
1343
the period over which wheighted average rate is calculated to produce ETA.
1345
.BR xfer:eta-terse \ (bool)
1346
show terse ETA (only high order parts). Default is true.
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.
1352
.BR xfer:rate-period \ (seconds)
1353
the period over which wheighted average rate is calculated to be shown.
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 `/'.
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
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'.
1375
.SS FTP asynchronous mode (pipelining)
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.
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''.
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.
1401
Switch on debugging mode
1404
Execute given commands and don't exit.
1407
Use the given port to connect
1409
.BI \-u " user\fR[\fP\fB,\fPpass\fR]\fP"
1410
Use the given username and password to connect
1412
.BI \-f " script_file"
1413
Execute commands in the file and exit
1416
Execute the given commands and exit
1418
.SH ENVIRONMENT VARIABLES
1419
The following environment variables are processed by \fBlftp\fR:
1421
Used for (local) tilde (`~') expansion
1423
Used by the \fB!\fR command to determine the shell to run.
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.
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.
1445
.I "~/.lftp/rc," "~/.lftprc"
1446
These files are executed on lftp startup after \fI/etc/lftp.conf\fR.
1449
The file things are logged to when lftp moves into the background in
1452
.I "~/.lftp/bookmarks"
1453
The file is used to store lftp's bookmarks. See the \fBbookmark\fR
1456
.I "~/.lftp/cwd_history"
1457
The file is used to store last working directories for each site visited.
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
1465
.BR ftpd "(8), " ftp (1)
1473
RFC2228 (ftp security extensions),
1479
http://www.ietf.org/internet-drafts/draft-murray-auth-ftp-ssl-11.txt
1482
http://www.ietf.org/internet-drafts/draft-ietf-ftpext-mlst-16.txt
1483
(ftp extensions over RFC959),
1485
http://www.ietf.org/internet-drafts/draft-ietf-secsh-filexfer-04.txt
1491
Alexander V. Lukyanov
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>.