The recursive flag is -R, not -r. From the cp man page:

"Historic versions of the cp utility had a -r option. This implementation
supports that option, however, its use is strongly discouraged, as it
does not correctly copy special files, symbolic links or fifo's."

Try using cp -R.

ahp

On Friday, Jan 3, 2003, at 12:15 America/New_York, John T. Douglass wrote:

On Fri, 2003-01-03 at 09:53, Ed Wilts wrote:
On Fri, Jan 03, 2003 at 11:45:14AM -0500, Jianping Zhu wrote:
I have redhat 7.1 linux server. i want to cp /home/blackduck to
/home1/blackduck (about 12G), i use commant cp -r /home/blackduck under
/home1. but after i finished cp, i use du /home1/blackduck>b1 and du
/home/blackduck>b2 to check and found out that
/home/blackduck and /home1/blackduck are of diffrent size
Your command is in error. Use cp -a instead of -r. You missed all the
. files the first time around.

This is not true. cp -r will in fact copy all the dot files. The
recursive option of copy picks up everything. It does not however
preserve the timestamps and links that the cp -a would (since the -a is
the same as a -dpR).

What is more like the case is that many zero filled files (such as core
dumps) were moved and when they were recreated they were no longer
sparse files. When moving large amounts of data to new file systems cp
-r simply is the best option. One alternative is a tar such as:

tar cfS - blackduck | (cd /home1; tar xpSf -)

The S is for sparse files and will handle them efficiently.

Alternatives would be a dump/restore pipe or cpio pipe similar to above.

-- John

--
John T. Douglass <[EMAIL PROTECTED]>
Argonne National Laboratory West



--
redhat-list mailing list
unsubscribe mailto:[EMAIL PROTECTED]?subject=unsubscribe
https://listman.redhat.com/mailman/listinfo/redhat-list

Attachment: PGP.sig
Description: PGP signature



Reply via email to