Operating System - HP-UX
1820561 Members
1986 Online
109626 Solutions
New Discussion юеВ

Re: ftp / scp resume download function

 
SOLVED
Go to solution
heaman1
Regular Advisor

ftp / scp resume download function

I would like to transfer a large file to another server , but I found that the connection is not stable so that the line often broken , that the file is incomplete transferred , can advise is there any command ( eg. ftp , scp ) / method could be resume download after the line is disconnected ? thx
10 REPLIES 10
Ganesan R
Honored Contributor

Re: ftp / scp resume download function

Hi Heaman,

There is a option available with ftp "reget".

reget remote-file [local-file]

reget acts like get, except that if local-file exists and is smaller than remote-file, local-file is presumed to be a partially transferred copy of remote-file and the transfer is continued from the apparent point of failure. This command is useful when transferring very large files over networks that tend to drop connections.


Refer this ftp man page for more details.

http://docs.hp.com/en/B2355-60127/ftp.1.html


Best wishes,

Ganesh.
Suraj K Sankari
Honored Contributor

Re: ftp / scp resume download function

Hi,

You can NFS mount the file system from server A to server B and then copy the file.

Suraj
Dennis Handly
Acclaimed Contributor
Solution

Re: ftp / scp resume download function

You could use split(1) and cat(1) to get smaller chunks. Then use mput to copy the files.
Matti_Kurkela
Honored Contributor

Re: ftp / scp resume download function

The "rsync" utility might be useful in this case. It is not installed in HP-UX by default, but is available for free in software.hp.com for HP-UX 11iv2 and 11iv3.

It's a part of the "HP-UX Internet Express" collection.

It can be used almost exactly like scp, but has a lot more options. To allow rsync to resume incomplete transfers, you should use the "--partial" option so that the copy won't be deleted when the connection fails.

To resume, just enter the same rsync command again: it will detect that the destination file exists but is incomplete, and will automatically resume from the correct point.

Modern versions of rsync will automatically use SSH as the default remote access method, so your data will be encrypted while in transit. If you don't need (or want) the overhead of encryption, you can configure rsync to use a non-encrypted transfer mode: you could make it use e.g. remsh instead of ssh, or set up a dedicated rsync server process.

MK
MK
heaman1
Regular Advisor

Re: ftp / scp resume download function

thx replies,

rsync seems good , but I may use the same method in my different unix-type server , eg . linux , so is there any command could do that ? thx
Steven E. Protter
Exalted Contributor

Re: ftp / scp resume download function

Shalom,

In most cases no configuration changes are required on the server to implement this functionality.

Its a function of the client software.

This feature is generally put into the client software.

My feeling here is that rsync with the -e ssh parameter to encrypt the data stream will provide most of the needed functionality, server to server.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
heaman1
Regular Advisor

Re: ftp / scp resume download function

thx reply ,

When use the command below , it pops the error , can advise do I need to config sth in remote server ?

rsync -e test.txt root@192.168.0.1:/tmp

error
=====
Failed to exec test.txt : Permission denied
rsync error: error in IPC code (code 14) at pipe.c(82)
rsync: connection unexpectedly closed (0 bytes read so far)
rsync error: error in rsync protocol data stream (code 12) at io.c(165)
Matti_Kurkela
Honored Contributor

Re: ftp / scp resume download function

The -e option requires an argument. For example, if you want to make sure rsync uses SSH connection method:
rsync -e ssh test.txt root@192.168.0.1:/tmp

But if you simply want to copy the file:
rsync test.txt root@192.168.0.1:/tmp

MK
MK
Prasu
Frequent Advisor

Re: ftp / scp resume download function

Hi,

You can try for rcp from server A to server B
or

If ssh is installed on both servers , you can use scp also.


Regards
Prasu
heaman1
Regular Advisor

Re: ftp / scp resume download function

thx Matti Kurkela ,

thx , I tried -e ssh , it works fine to remote file to remote server,
but I do the testing , copy a large file to remote server , then reboot this remote file , the local server pops the below error , then the copy process stopped and not resumed again , if I want it will be resume download until the file copying is complete , what can i do ? thx


rsync: writefd_unbuffered failed to write 4 bytes: phase "unknown": Broken pipe
rsync error: error in rsync protocol data stream (code 12) at io.c(515)

ps. I do the test on linux box.