Advertisement
asanchez75

lftp/ftp/rsync

Nov 1st, 2013
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.95 KB | None | 0 0
  1. http://www.cyberciti.biz/faq/lftp-mirror-example/
  2. http://networklessons.com/linux/lftp-stuck-making-data-connection/
  3. http://crashingdaily.wordpress.com/2007/06/29/rsync-and-sudo-over-ssh/
  4.  
  5. First, you need to connect to the remote ftp server using the following syntax:
  6. lftp ftp.cyberciti.biz
  7.  
  8. Type username and password:
  9.  
  10. lftp ftp.cyberciti.biz:~> user [email protected]
  11. Sample outputs:
  12.  
  13. Password:
  14. lftp [email protected]@rawlogs.bitgravity.com:~>
  15. Type ls command to see a list of files:
  16.  
  17. lftp ftp.cyberciti.biz:~> ls
  18. Sample outputs:
  19.  
  20. -rw-r--r-- 1 80 www 36809419 Jun 24 23:59 2012-06-24.log.gz
  21. -rw-r--r-- 1 80 www 100912271 Jun 25 23:59 2012-06-25.log.gz
  22. -rw-r--r-- 1 80 www 102926055 Jun 26 23:59 2012-06-26.log.gz
  23. To mirror all of the above files in the current directory, enter:
  24.  
  25. lftp ftp.cyberciti.biz:~> mirror
  26. 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:
  27.  
  28. lftp ftp.cyberciti.biz:~> mirror source target
  29. OR
  30.  
  31. lftp ftp.cyberciti.biz:~> mirror logs/ /data/wwwlogs
  32. 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
  33.  
  34. lftp ftp.cyberciti.biz:~> mirror -c source target
  35. OR
  36.  
  37. lftp ftp.cyberciti.biz:~> mirror --continue
  38. To download only newer files (-c won't work):
  39.  
  40. lftp ftp.cyberciti.biz:~> mirror --only-newer
  41. OR
  42.  
  43. lftp ftp.cyberciti.biz:~> mirror -n
  44. You can speed up ftp mirror operation by downloading files in parallel using the following syntax:
  45.  
  46. lftp ftp.cyberciti.biz:~> mirror -p
  47. To download 10 files in parallel, enter:
  48.  
  49. lftp ftp.cyberciti.biz:~> mirror --parallel=10
  50. You can use pget to transfer every single file:
  51.  
  52. lftp ftp.cyberciti.biz:~> mirror -c --use-pget-n=10
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement