bug-coreutils
[Top][All Lists]
Advanced

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

Re: cp: preserve existing destination file


From: Bob Proulx
Subject: Re: cp: preserve existing destination file
Date: Tue, 22 Apr 2008 19:46:51 -0600
User-agent: Mutt/1.5.13 (2006-08-11)

address@hidden wrote:
> Unfortunately, after a new system installation, I just today
> discovered, that the --reply=foo option in cp has been deprecated
> and is going to be removed.

Yes.  It didn't do what people thought it did.  It was possible to
have silent data loss.

> I often want to do "cp dir1/* dir2", but protect the files already
> existing in dir2 from being overwritten by the older files from
> dir1.  I could use "-u", but I often deal with files, on whose
> timestamps I cannot safely rely on.  How to do this without "-i
> --reply=no"? Or is there anything I overlooked? Hope not.

Use rsync for this functionality.

  $ rsync -a --ignore-existing file1 file2

See this reference for more information:

  
http://www.gnu.org/software/coreutils/faq/#cp-and-mv-the-reply-option-is-deprecated

Bob




reply via email to

[Prev in Thread] Current Thread [Next in Thread]