bug-coreutils
[Top][All Lists]
Advanced

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

Re: cp -u


From: Philip Rowlands
Subject: Re: cp -u
Date: Sat, 14 Jun 2008 14:55:25 +0100 (BST)

On Sat, 14 Jun 2008, Markku A. Mähönen wrote:

I noticed that if, for some reason, the copy of a file is interrupted (and so the destination file is not the same size as the source) and after that you do 'cp -u' again it does not update the interrupted file. So the 'cp -u' does not care about the file size mismatch and cares only about the timestamps.

So I would like to suggest that 'cp -u' should also check the size of the files and do a copy if source is newer, or if destination is missing, or if file sizes are different.

You might find rsync to be a better tool for this task. It's more robust against partial-copy failures, and has the nice property that copied files will all carry the same mtime, whereas cp -u will not attempt to replicate timestamps (from a cursory check).


Cheers,
Phil




reply via email to

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