Showing posts with label download. Show all posts
Showing posts with label download. Show all posts

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!

Thursday, February 19, 2009

rsync + ssh => resumable download

rsync + ssh => resumable download

Sometimes ago, I felt the necessity of being able to resume my download from another computer, specially if the file is quite big. In this case, it's time to use rsync. Since mostly I use ssh to access remote computer, so I combine rsync with ssh.

Here's how to do it:
$ rsync --partial --progress --rsh=ssh user@server:/serverpath/to/file /localpath/to/file

Now, what if you need to use non-standard ssh port? Let's say you need to connect to ssh via port 7890. The command will be like the following:
$ rsync --partial --progress --rsh='ssh -p7890' user@server:/serverpath/to/file /localpath/to/file

The neat thing is that there is also progress indicator shown.