[/opt/opthb/work/ymm/OpenSource]$bzip2 -d lftp-4.0.1.tar.bz2
[/opt/opthb/work/ymm/OpenSource]$tar -xzvf lftp-4.0.1.tar
[/opt/opthb/work/ymm/OpenSource]$ls
lftp-4.0.1/
[/opt/opthb/work/ymm/OpenSource]$ls
lftp-4.0.1.tar.bz2
-j, --bzip2
filter the archive through bzip2
[/opt/opthb/work/ymm/OpenSource/lftp-4.0.1]$ ./configure --prefix=“/opt/opthb/work/ymm/usr/local”
[/opt/opthb/work/ymm/OpenSource/lftp-4.0.1]$ make
[/opt/opthb/work/ymm/OpenSource/lftp-4.0.1]$ make install
[/opt/opthb/work/ymm/OpenSource/lftp-4.0.1]$ cd /opt/opthb/work/ymm/usr/local
[/opt/opthb/work/ymm/usr/local]$ls
bin etc lib share
[/opt/opthb/work/ymm/usr/local]$ls bin
help lftp lftpget
[/opt/opthb/work/ymm/usr/local]$lftp
-bash: lftp: command not found
[/opt/opthb/work/ymm/usr/local]$export PATH=/opt/opthb/work/ymm/usr/local/bin:${PATH}
[/opt/opthb/work/ymm/usr/local]$lftp
lftp :~>
[/opt/opthb/work/ymm/usr/local]$lftp
lftp :~> open 172.21.0.21
lftp 172.21.0.21:~> user billing_dx
Password:
lftp [email protected]:~>
lftp [email protected]:~/work/ymm> help mirror
Usage: mirror [OPTS] [remote [local]]
Mirror specified remote directory to local directory
-c, --continue continue a mirror job if possible
-e, --delete delete files not present at remote site
--delete-first delete old files before transferring new ones
-s, --allow-suid set suid/sgid bits according to remote site
--allow-chown try to set owner and group on files
--ignore-time ignore time when deciding whether to download
-n, --only-newer download only newer files (-c won't work)
-r, --no-recursion don't go to subdirectories
-p, --no-perms don't set file permissions
--no-umask don't apply umask to file modes
-R, --reverse reverse mirror (put files)
-L, --dereference download symbolic links as files
-N, --newer-than=SPEC download only files newer than specified time
-P, --parallel[=N] download N files in parallel
-i RX, --include RX include matching files
-x RX, --exclude RX exclude matching files
RX is extended regular expression
-v, --verbose[=N] verbose operation
--log=FILE write lftp commands being executed to FILE
--script=FILE write lftp commands to FILE, but don't execute them
--just-print, --dry-run same as --script=-
When using -R, the first directory is local and the second is remote.
If the second directory is omitted, basename of first directory is used.
If both directories are omitted, current local and remote directories are used.
lftp [email protected]:~> lcd /opt/opthb/work/ymm/test/
lcd ok, local cwd=/opt/opthb/work/ymm/test
lftp [email protected]:~/work/ymm> mirror DataGen/
Total: 3 directories, 15 files, 0 symlinks
Modified: 1 file, 0 symlinks
195 bytes transferred
mirror -R上传文件夹(不可以单独的文件)
lftp [email protected]:/tmp/temp> mirror -R ymm.txt #上传文件出错
mirror: Access failed: /opt/opthb/work/ymm/test/ymm.txt: Not a directory
1 error detected
lftp [email protected]:/tmp/temp> mirror -R test #上传目录正常
Total: 38 directories, 289 files, 0 symlinks
New: 289 files, 0 symlinks
3047762 bytes transferred in 2 seconds (1.89M/s)
To be removed: 0 directories, 1 file, 0 symlinks
lftp [email protected]:/tmp/temp> mirror -c --parallel=2 sub sub2
Total: 1 directory, 4 files, 0 symlinks
New: 4 files, 0 symlinks