From owner-freebsd-questions@FreeBSD.ORG Mon Sep 5 21:49:32 2011 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3D5A31065675 for ; Mon, 5 Sep 2011 21:49:32 +0000 (UTC) (envelope-from carlj@peak.org) Received: from redcondor2.peak.org (redcondor2.peak.org [69.59.192.56]) by mx1.freebsd.org (Postfix) with ESMTP id 0A8148FC12 for ; Mon, 5 Sep 2011 21:49:31 +0000 (UTC) Received: from zmail-mta02.peak.org ([207.55.16.112]) by redcondor2.peak.org ({6c724cae-de34-4c5f-b615-3072b86419fa}) via TCP (outbound) with ESMTP id 20110905214931370 for ; Mon, 05 Sep 2011 21:49:31 +0000 X-RC-FROM: X-RC-RCPT: Received: from maple.localnet (unknown [207.55.106.132]) by zmail-mta02.peak.org (Postfix) with ESMTPSA id DD4AF6C8831 for ; Mon, 5 Sep 2011 14:49:30 -0700 (PDT) Received: from oak.localnet (oak.localnet [IPv6:2001:1938:266::6f:616b]) by maple.localnet (Postfix) with ESMTP id BFD0461F9B for ; Mon, 5 Sep 2011 14:49:29 -0700 (PDT) Received: from oak.localnet (localhost.localnet [127.0.0.1]) by oak.localnet (Postfix) with ESMTP id 9605BCF8D for ; Mon, 5 Sep 2011 14:49:29 -0700 (PDT) Received: (from carlj@localhost) by oak.localnet (8.14.4/8.14.4/Submit) id p85LnTDw081746; Mon, 5 Sep 2011 14:49:29 -0700 (PDT) (envelope-from carlj@peak.org) X-Authentication-Warning: oak.localnet: carlj set sender to carlj@peak.org using -f From: Carl Johnson To: freebsd-questions@freebsd.org References: <20110905175808.6b534002.freebsd@edvax.de> Mail-Followup-To: freebsd-questions@freebsd.org Date: Mon, 05 Sep 2011 14:49:29 -0700 In-Reply-To: <20110905175808.6b534002.freebsd@edvax.de> (Polytropon's message of "Mon, 5 Sep 2011 17:58:08 +0200") Message-ID: <87ipp664nq.fsf@oak.localnet> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: Re: cpio command and schg flags 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, 05 Sep 2011 21:49:32 -0000 Polytropon writes: > 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? I think that tar will also work (but not gnu tar), and it is part of the base system. The manpage does show an example of how to do this, but calls it moving the file heirarchy. -- Carl Johnson carlj@peak.org