According to the cp man page:
-p  Cause cp to preserve the following attributes of each source file
in the copy: modification time, access time, file flags, file mode,
   user ID, and group ID, as allowed by permissions.

   If the user ID and group ID cannot be preserved, no error message
   is displayed and the exit value is not altered.
However, when I run this script or when I do a cp -p manually I am seeing:
        cp: chown: /stats/maillogs/maillog-copy-test.bz2: Permission denied
You need to run this as root so the permissions and ownership all can be set.
-Derek

I think you misunderstand the poster's complaint. It's not that the permissions aren't being set, it's that the documentation is incorrect. This part:
        If the user ID and group ID cannot be preserved, no error message
        is displayed and the exit value is not altered.
is not in accordance to the behaviour that they are seeing. The owner and/or group could not be set, but cp(1) fails, and displays a message, but the documentation says that it should not display an error message or fail. _______________________________________________
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to