[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: scp non-overwrite option



Thanks Bob.

On Thu, 2007-08-02 at 23:17 -0600, Bob Proulx wrote:
> Bhasker C V wrote:
> >   I was trying to scp a large directory from server to my box (server on
> > FC and my desktop on etch). I use scp -r option to copy all the files.
> > But when it happens that the scp fails somewhere, i cannot ask it to
> > continue by omitting the ones it has already copied.
> 
> This is a perfect application for 'rsync'.
> 
>   rsync -av /from/here/dir example.com:/to/there/
> 
> The rsync program will only copy what needs to be copied.  This means
> it can be interrupted and restarted and will quite efficiently
> complete the copy without transmitting the previously copied data.
> 
> > For example in the standard cp command, i can give a '-i' option to
> > interactively ask if the command is going to overwrite a file
> > already present.
> 
> Grr...  That is a blunt and coarse use of 'cp -i'.  You would have to
> answer 'n'o to a lot of questions.  Or use 'yes n | cp -i' and that
> seems worse.  Of course 'cp -u' will avoid copying the previously
> copied files too but better to use rsync here.
> 
> > Why is this option not present in scp ?
> 
> Because it is not needed because it exists in other commands.  scp is
> simply an rcp lookalike command.
> 
> Bob
> 
> 
-- 
Bhasker C V
Registered Linux user: #306349 (counter.li.org)
The box said "Requires Windows 95, NT, or better", so I installed Linux.



Reply to: