xs@kittenz.org writes:
Richard Kettlewell wrote:
"cp -a" should work fine. Other possible invocations of cp might well cause problems, and AFAIK all the non-GNU versions of cp don't have the feature at all...
they do. SuSv3 has it -- just not as -a, which is a gnu extension. cp -RPp is the SuSv3 and POSIX way.
...in fact looking at the spec I can't see anything about -P which guarantees hard links to be preserved, which is part of the requirement (and part of what GNU cp -a does). Indeed it says:
in particular, pax maintains the hard-link structure of the hierarchy, while cp does not.
i.e. POSIX cp is not up to the job.