Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- http://www.cyberciti.biz/faq/lftp-mirror-example/
- http://networklessons.com/linux/lftp-stuck-making-data-connection/
- http://crashingdaily.wordpress.com/2007/06/29/rsync-and-sudo-over-ssh/
- First, you need to connect to the remote ftp server using the following syntax:
- lftp ftp.cyberciti.biz
- Type username and password:
- lftp ftp.cyberciti.biz:~> user [email protected]
- Sample outputs:
- Password:
- lftp [email protected]@rawlogs.bitgravity.com:~>
- Type ls command to see a list of files:
- lftp ftp.cyberciti.biz:~> ls
- Sample outputs:
- -rw-r--r-- 1 80 www 36809419 Jun 24 23:59 2012-06-24.log.gz
- -rw-r--r-- 1 80 www 100912271 Jun 25 23:59 2012-06-25.log.gz
- -rw-r--r-- 1 80 www 102926055 Jun 26 23:59 2012-06-26.log.gz
- To mirror all of the above files in the current directory, enter:
- lftp ftp.cyberciti.biz:~> mirror
- With mirror lftp command you can specify source directory to local target directory. If target directory ends with a slash, the source base name is appended to target directory name. Source and/or target can be URLs pointing to directories. The syntax is:
- lftp ftp.cyberciti.biz:~> mirror source target
- OR
- lftp ftp.cyberciti.biz:~> mirror logs/ /data/wwwlogs
- I highly recommend that you start mirror job with resume option. This make sure if ftp mirror was failed due to network connection it will only download partial file
- lftp ftp.cyberciti.biz:~> mirror -c source target
- OR
- lftp ftp.cyberciti.biz:~> mirror --continue
- To download only newer files (-c won't work):
- lftp ftp.cyberciti.biz:~> mirror --only-newer
- OR
- lftp ftp.cyberciti.biz:~> mirror -n
- You can speed up ftp mirror operation by downloading files in parallel using the following syntax:
- lftp ftp.cyberciti.biz:~> mirror -p
- To download 10 files in parallel, enter:
- lftp ftp.cyberciti.biz:~> mirror --parallel=10
- You can use pget to transfer every single file:
- lftp ftp.cyberciti.biz:~> mirror -c --use-pget-n=10
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement