From owner-freebsd-questions@FreeBSD.ORG Mon Sep 5 15:58:11 2011 Return-Path: Delivered-To: questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1DBD41065674 for ; Mon, 5 Sep 2011 15:58:11 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mx02.qsc.de (mx02.qsc.de [213.148.130.14]) by mx1.freebsd.org (Postfix) with ESMTP id D519A8FC13 for ; Mon, 5 Sep 2011 15:58:10 +0000 (UTC) Received: from r56.edvax.de (port-92-195-14-151.dynamic.qsc.de [92.195.14.151]) by mx02.qsc.de (Postfix) with ESMTP id 71DA31DEFA; Mon, 5 Sep 2011 17:58:09 +0200 (CEST) Received: from r56.edvax.de (localhost [127.0.0.1]) by r56.edvax.de (8.14.5/8.14.5) with SMTP id p85Fw9bb002678; Mon, 5 Sep 2011 17:58:09 +0200 (CEST) (envelope-from freebsd@edvax.de) Date: Mon, 5 Sep 2011 17:58:08 +0200 From: Polytropon To: joeb1@a1poweruser.com Message-Id: <20110905175808.6b534002.freebsd@edvax.de> In-Reply-To: References: Organization: EDVAX X-Mailer: Sylpheed 3.1.1 (GTK+ 2.24.5; i386-portbld-freebsd8.2) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: "Questions@Freebsd. Org" Subject: Re: cpio command and schg flags X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Polytropon List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Sep 2011 15:58:11 -0000 On Mon, 5 Sep 2011 11:32:05 -0400, joeb1 wrote: > I am trying to use this code sequence to clone a directory tree. > mkdir /usr/test1 > cd /var > find . | cpio -dmp /usr/test1 > > The result is /usr/test1 gets populated with the directory tree but > all the schg flags get stripped off. > > How can I keep the schg flags in the cloned directory? As far as I remember, cpio doesn't copy flags. But you can use either dump + restore, or dpdup (from ports). >From "man cpdup": The cpdup utility makes an exact mirror copy of the source in the destination, creating and deleting files and directories as necessary. UTimes, hardlinks, softlinks, devices, permissions, and flags are mirrored. Flags are explicitely mentioned here. Maybe you can give this program a try? -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...