GNU bug report logs - #8636
cp -x flag does not work

Previous Next

Package: coreutils;

Reported by: obb33 <at> verizon.net

Date: Sat, 7 May 2011 20:16:01 UTC

Severity: normal

Done: Jim Meyering <jim <at> meyering.net>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Jim Meyering <jim <at> meyering.net>
To: peek <at> kutek.info
Cc: 8636 <at> debbugs.gnu.org
Subject: bug#8636: closed (Re: bug#8636: cp -x flag does not work)
Date: Thu, 15 Sep 2011 18:18:48 +0200
peek <at> kutek.info wrote:
> I would ask you again to reconsider your view on this issue  because it is
> irrational.
>
> you are claiming functionality that you do not provide (stay on one file
> system during a potentially recursive copy ) while allowing recursion into
> other file systems if they are mounted beneath the directory you are
> copying.
>
> why you think that this constitutes staying  on one filesystem eludes me.
>
> find does this correctly ( -xdev or -mount switches) and coreutil's cp and
> mv can and should too.
>
> thanks for all the great work on coreutils and other of your work. if i had
> programming skills, i would fix this myself and provide a patch, but i
> don't.

You used this command:

    cp -xvdpR /* /newdirectory

That tells cp explicitly to copy every top-level directory under /.
i.e., for each directory one level under /, cp copies it to
newdirectory, but without traversing into a directory residing
on a device different than the command-line-specified directory.
That is how cp -x is documented to work.

To get the behavior you want, run this command:

    cp -xvdpR / /newdirectory

(note there's no "*" here, as you surmised in
http://debbugs.gnu.org/cgi/bugreport.cgi?bug=8636#11
your use of the "*" wildcard is what caused problems)

I hope you see that there is nothing to reconsider
and that cp -x can do precisely what you want.




This bug report was last modified 13 years and 248 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.