Wednesday, December 16, 2009

multipart sftp download and resume using lftp

Previously I wrote about how to resume scp download using rsync. It is pretty nice. After working a lot with scp and sftp, I was looking for a way to perform multipart download using sftp. It is pretty easy to resume sftp download, since there is already 'reget' command. Then I read some article about lftp. I thought that it was just another ftp client. I was wrong. Taken from the website itself, 'LFTP is sophisticated ftp/http client.' Truly sophisticated. Check more information about lftp from wiki.
One of the coolest feature is the ability to resume and multi-part sftp download. The command itself is pretty simple. Here is how one can do it:

$ lftp -e 'pget -c -n 5 /path/to/file' sftp://username@server


short explanation:
-e: lftp option to execute command
pget: is the command for partial download
-c: pget option to resume
-n: pget option for number of parts

Enjoy!

2 comments:

  1. Thanks for the post. Aptly titled. Helped me !

    ReplyDelete
  2. Thanks! Worked fine. Good to be able to resume a 15GB file download

    ReplyDelete