From owner-freebsd-questions@FreeBSD.ORG Mon Aug 28 18:48:24 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7F5F416A4DA for ; Mon, 28 Aug 2006 18:48:24 +0000 (UTC) (envelope-from derek@betty.computinginnovations.com) Received: from betty.computinginnovations.com (dsl081-142-072.chi1.dsl.speakeasy.net [64.81.142.72]) by mx1.FreeBSD.org (Postfix) with ESMTP id C558B43D55 for ; Mon, 28 Aug 2006 18:48:23 +0000 (GMT) (envelope-from derek@betty.computinginnovations.com) Received: from betty.computinginnovations.com (localhost.computinginnovations.com [127.0.0.1]) by betty.computinginnovations.com (8.13.6/8.12.11) with ESMTP id k7SIm7n3057451; Mon, 28 Aug 2006 13:48:07 -0500 (CDT) Received: from localhost (derek@localhost) by betty.computinginnovations.com (8.13.6/8.12.11/Submit) with ESMTP id k7SIm7Zk057448; Mon, 28 Aug 2006 13:48:07 -0500 (CDT) Date: Mon, 28 Aug 2006 13:48:07 -0500 (CDT) From: Derek Ragona To: "Gabriel O'Brien" In-Reply-To: <44F33207.2070401@nm.cbc.ca> Message-ID: <20060828134729.U57414@betty.computinginnovations.com> References: <44F33207.2070401@nm.cbc.ca> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-ComputingInnovations-MailScanner-Information: Please contact the ISP for more information X-ComputingInnovations-MailScanner: Found to be clean X-ComputingInnovations-MailScanner-From: derek@betty.computinginnovations.com X-Spam-Status: No Cc: freebsd-questions@freebsd.org Subject: Re: FreeBSD 5.4: 'cp -p' does not behave as documented X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Aug 2006 18:48:24 -0000 You need to run this as root so the permissions and ownership all can be set. -Derek On Mon, 28 Aug 2006, Gabriel O'Brien wrote: > Hi folks, > > FreeBSD 5.4-RELEASE-p6 i386 > > We have a script in our environment that is used to back up our mail logs. > In essence it does: > > cp -p /var/log/maillog.0.bz2 /stats/maillogs/maillog-testcopy.bz2 > > 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 > > For the record the user does not actually have permissions to do the chown, > however we would still like to use 'cp -p' in order to preserve the remainder > of the attributes and according to the docs this should be possible. Does > anybody have any insight? > > I note this issue does not appear to exist on our FreeBSD 6.1 boxes. > > cheers, > Gabriel O'Brien > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org" > > -- > This message has been scanned for viruses and > dangerous content by MailScanner, and is > believed to be clean. > MailScanner thanks transtec Computers for their support. > > -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. MailScanner thanks transtec Computers for their support.