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

Re: Copying only files that are not into the destination



--- On Fri, 12/25/09, Girish Kulkarni <girish@athene.org.in> wrote:

> From: Girish Kulkarni <girish@athene.org.in>
> Subject: Re: Copying only files that are not into the destination
> To: "Debian-user" <debian-user@lists.debian.org>
> Date: Friday, December 25, 2009, 5:41 AM
> On Thu, 24 Dec 2009, Brad Rogers
> wrote:
> >> copied in /destination/. Using cp -i is not a good
> idea, as there
> >> could be something like ~5000 files which are not
> in /destination/,
> >> but which are in /source/.
> > 
> > cp -n does that.
> 
> Wonder if I'm missing something, but `cp -n' on Lenny gives
> me this:
> 
>     girish@marvin:~$ cp -n -r foo /tmp
>     cp: invalid option -- n
>     Try `cp --help' for more information.
> 
> Girish.
> 

Probably meant 
cp -u

the u means update, so that cp only copies the file if
either it doesn't already exist in /destination
or if the file of that name in /source is newer
than the one in /destination.
Pretty well rsync can do the same thing.

/tony
--
http://www.baldwinlinguas.com
translations & interpreting

http://www.baldwinsoftware.com
tcl yer os with a feather






Reply to: