Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

at work, I sshed to a remote server at another location of my company. I generally use scp to copy files from/to remote server from local Ubuntu machine i work on.

Recently while I was copying a file which was of size around 3GB, the VPN connection to our remote site went down and thus interrupted the file copy when only around 1.5GB of file was copied. Even this copy took ages(due to our slow link).

Is there any file copy app(ftp based/scp based/any other standalone app) under Linux/Unix to copy files such that if interrupted, they can begin copy from correct state while avoiding having to redo the whole thing of copying from beginning?

share|improve this question

1 Answer 1

Check out rsync - that is doing exactly that.

From the man page:

Rsync is a fast and extraordinarily versatile file  copying  tool.   It
can  copy  locally,  to/from  another  host  over  any remote shell, or
to/from a remote rsync daemon.  It offers a  large  number  of  options
that  control  every  aspect  of  its behavior and permit very flexible
specification of the set of files to be copied.  It is famous  for  its
delta-transfer  algorithm,  which  reduces the amount of data sent over
the network by sending only the differences between  the  source  files
and  the  existing  files in the destination.  Rsync is widely used for
backups and mirroring and as an improved copy command for everyday use.
share|improve this answer
    
Tried it. the partially copied file was NOT copied using rsync but using scp. Then tried giving rsync command as : rsync file.tar.gz myusername@myhost:~/. It did something of delta file computation , resulting file size showed correct size, but cotnents were bad. The archvie was corrupted. Does rsync not work on some partial file copied using some other command, but not rsync? –  goldenmean Oct 19 '11 at 14:49
    
Should actually - I sometimes move files around on the server, and do the same on the backup, to make sure that I don't have to copy everything again, and rsync compares the files and skips them. Look in the manual for rsync - there is are different options to control the behaviour when comparing files - maybe tehy help? –  Rainer Oct 19 '11 at 15:23

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.