bug-coreutils
[Top][All Lists]
Advanced

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

Re: --preserve (cp is still changing file?)


From: Bob Proulx
Subject: Re: --preserve (cp is still changing file?)
Date: Tue, 21 Mar 2006 23:32:58 -0700
User-agent: Mutt/1.5.9i

The Batterson's wrote:
> The preserve function isn't working properly.

Thank you for your report.  But in order to understand the problem you
are having we need more information.  The preserve function is working
for me and must also be working for many other people otherwise we
would have more bug reports about it.

What version of cp from coreutils are you using?  Use --version to
determine this.

  cp --version

What operating system are you using?  Usually uname -a helps here.

  uname -a

What filesystems are involved?  The 'df -T' command may be useful
here.

  df -T .

> rsync copies over the existing file even though it's the same file.

The default for rsync is that if the file timestamp and size match
then it will assume the files are the same.

> Is cp changing something even though I have --preserve?  It doesn't
> seem to be preserving the time stamp.

If you would look at the file size, timestamp and contents after the
copy and verify that the file either is or is not the same after the
copy that is the information needed.

  ls -ld somefile
  cp -p somefile someotherfile
  ls -ld someotherfile

> Please see the script below.

> # KFI Tech Guy
> ls -t ~/iPodderData/downloads/'KFI Tech Guy' | head -2 | xargs -i cp -v 
> --preserve ~/iPodderData/downloads/'KFI Tech Guy'/{} 
> ~/iPodderData/downloads/temp/{}
> rm ~/iPodderData/downloads/'KFI Tech Guy'/*
> cp -v --preserve ~/iPodderData/downloads/temp/* 
> ~/iPodderData/downloads/'KFI Tech Guy'/
> rsync -a --progress --delete ~/iPodderData/downloads/'KFI Tech Guy'/ 
> /media/usbdisk/Podcasts/'KFI Tech Guy'/
> rm ~/iPodderData/downloads/temp/*

Unfortunately your script does not illustrate any problems to me.  It
is just a series of commands with no results of those commands.

Bob




reply via email to

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