|
Softpanorama |
May the source be with you, but remember the KISS principle ;-)
Softpanorama Search
|
| FTP Protocol | Recommended Links | Reference | Cygwin | NetDrive | FTP Security | |
| FileZilla | NcFTP | wget | rsync | Curl | Humor | Etc |
LFTP is available on Unix systems (Solaris, Linux, etc) both Windows (via Cygwin, included in standard list of packages). It is well designed and offer productivity boost for knowledgeable admin and advanced users. It was written by Alexander V. Lukyanov . I instantly discarded ncftp when I learned about lftp.
There is the author web site devoted to this program: LFTP - sophisticated file transfer program
LFTP is sophisticated file transfer program with command line interface. It supports FTP, HTTP, FISH, SFTP, HTTPS and FTPS protocols. GNU Readline library is used for input.Every operation in lftp is reliable, that is any non-fatal error is handled and the operation is retried automatically. So if downloading breaks, it will be restarted from the point automatically. Even if ftp server does not support REST command, lftp will try to retrieve the file from the very beginning until the file is transferred completely. This is useful for dynamic-ip machines which change their IP addresses quite often, and for sites with very bad internet connectivity.
If you exit lftp when some jobs are not finished yet, lftp will move itself to nohup mode in background. The same happens when you have a real modem hangup or when you close an xterm.
lftp has shell-like command syntax allowing you to launch several commands in parallel in background (&). It is also possible to group commands within () and execute them in background. All background jobs are executed in the same single process. You can bring a foreground job to background with ^Z (c-z) and back with command `wait' (or `fg' which is alias to `wait'). To list running jobs, use command `jobs'. Some commands allow redirecting their output (cat, ls, ...) to file or via pipe to external command. Commands can be executed conditionally based on termination status of previous command (&&, ||).
Examples:
lftp> cat file | gzip > file.gz lftp> get file & lftp> (cd /path && get file) &The first command retrieves file from ftp server and passes its contents to gzip which in turn stores compressed data to file.gz. Other commands show how to start commands or command groups in background.lftp has builtin mirror which can download or update a whole directory tree. There is also reverse mirror (mirror -R) which uploads or updates a directory tree on server.
There is command `at' to launch a job at specified time in current context, command `queue' to queue commands for sequential execution for current server, and much more.
LFTP supports IPv6 for both FTP and HTTP protocols. For FTP protocol it uses method described in RFC2428.
Other low level stuff supported: ftp proxy, http proxy, ftp over http, opie/skey, fxp transfers, socks.
LFTP supports secure versions of the protocols FTP and HTTP: FTPS (explicit and implicit) and HTTPS. LFTP needs to be libked with an SSL library to support them. GNU TLS and OpenSSL are both supported as SSL backend.
If lftp was compiled with OpenSSL library, then it includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit. (http://www.openssl.org/)
See FEATURES for more detailed list of features.
See man page lftp(1) for more details.
lftp: a better FTP client by Peter Matulis
lftp - Wikipedia, the free encyclopedia
Linux Command Directory lftp - O'Reilly Media
LinuxPlanet - Tutorials - Moving Files In Linux - lftp
lftp to accelerate ftp - http download speed under Linux and UNIX
lftp [options] [url]
File transfer program with more features than ftp. The lftp command allows FTP and HTTP protocol transfers, plus other protocols including FISH (SSH based), FTPS, and HTTPS. It uses a shell-like command interface and offers job control in a manner similar to bash. lftp has two important reliability features: it resumes failed or interrupted transactions, and it goes into the background automatically if it is quit in the middle of a file transfer.
Run in debug mode.
Start, execute the specified commands, and then wait for further instructions.
Connect to the specified port number.
Login to the server with the username (and, optionally, password) you specify.
Run the specified script file of lftp
commands , then exit.
Run the commands specified, then exit.
The lftp commands are similar to those for ftp. However, lftp lacks or uses different mechanisms for a number of commands, including $, ascii, binary, case, and macdef. It also adds the following:
Create an alias for a command. For example, you could set dir to be an alias for ls -lf.
Set the username to anonymous. This is the default username.
Execute a command at a given time, as with the at command in an actual shell.
The lftp bookmark command used with the following arguments will add, delete, edit, import, or list bookmarks, respectively:
add name url
del name
edit
import type
list
Work with the local memory cache. This command should be followed by the arguments:
stat Display the status for the cache.
on|off Turn caching on or off.
flush Empty the cache.
size n Set the maximum size for the cache. Setting it to -1 means unlimited.
expire nu Set the cache to expire after n units of time. You can set the unit to seconds (s), minutes (m), hours (h), or days (d). For example, for a cache that expires after an hour, use the syntax cache expire 1h.
Where the ftp version of this command just stops all sessions, this version closes idle connections with the current server. If you have connections to multiple servers and wish to close all idle connections, add the -a flag.
Execute the specified lftp
command, with the specified arguments, ignoring any aliases created with the alias command.
Copy a directory exactly. The mirror command accepts the following arguments:
-c, --continue If mirroring was interrupted, resume it.
-e, --delete Delete local files that are not present at the remote site.
-s, --allow-suid Keep the suid/sgid bits as set on the remote site.
-n, --only-newer Get only those files from the remote site that have more recent dates than the files on the local system. Cannot be used with the -c argument.
-r, --no-recursion Do not get any subdirectories.
--no-umask Do not use umask when getting file modes. See umask for more information about file modes.
-R, --reverse Mirror files from the local system to the remote system. With this argument, make sure that you specify the local directory first and the remote directory second. If you do not specify both directories, the second is assumed to be the same as the first. If you choose neither, the operation occurs in the current working directories.
-L, --dereference When mirroring a link, download the file the link points to rather than just the link.
-N, --newer-than filename Get all files newer than the file filename.
-P, --parallel[=n] Download n files in parallel.
-i, --include regex Get only the files whose names match the regular expression regex. See grep for more information about regular expressions.
-x, --exclude regex Do not get the files whose names match regex. See grep for more information about regular expressions.
-t, time-prec n Set the precision of time measurement for file comparison; if file dates differ by amounts less than n, they are assumed to be the same. You can specify n in seconds (s), minutes (m), hours (h), or days (d).
-T, --loose-time-prec n Set the precision for loose time comparisons. You can specify n in seconds (s), minutes (m), hours (h), or days (d).
-v, --verbose=n Set the verbose level. You can set n from 0 (no output) to 3 (full output) using a number or by repeating the v. For example, -vvv is level 3 verbose mode.
--use-cache Use the cache to get directory listings.
--remove-source-files Move, rather than copy, files when mirroring.
Set one of the preference variables for lftp
. If run without arguments, list the variables that have been changed; without arguments and with the -a or -d flags, list all values or default values, respectively. See the lftp manpage for a complete list of preference variables that can be set.
Wait for the job or jobs you specify by number, or all jobs, to terminate.
Copyright © 1996-2009 by Dr. Nikolai Bezroukov. www.softpanorama.org was created as a service to the UN Sustainable Development Networking Programme (SDNP) in the author free time. Submit comments This document is an industrial compilation designed and created exclusively for educational use and is placed under the copyright of the Open Content License(OPL). Site uses AdSense so you need to be aware of Google privacy policy. Original materials copyright belong to respective owners. Quotes are made for educational purposes only in compliance with the fair use doctrine.
Disclaimer:
Last modified: August 12, 2009