From owner-freebsd-questions@FreeBSD.ORG Tue Sep 6 23:58:45 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 970FC106564A for ; Tue, 6 Sep 2011 23:58:45 +0000 (UTC) (envelope-from fbsd8@a1poweruser.com) Received: from mail-03.name-services.com (mail-03.name-services.com [69.64.155.195]) by mx1.freebsd.org (Postfix) with ESMTP id 6FBFA8FC0C for ; Tue, 6 Sep 2011 23:58:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; q=dns/txt; s=DKIM-NAME-SERVICES; d=a1poweruser.com; h=From:To:Cc:Subject:Message-ID:X-Sender:X-Envelope-From; l=500; bh=cQF4E9UtivQlkiBY3VCVoM+8GjCkfp8yMqSpujdyBoc=; b=ZWXlhrR9f3oZTf/Vn4nDHDR+hSKRuPHhGFOoeYbJHXl39KIL66MaAMZZj0BDylTdXw75v3To9tpPhX7Zl7dNvmb+yC9YX+1DV63YdDxN3Quxs+KKUm/Vm+fr8oIOP/iEIW3rCCM1nrJMUN7+fbpO63DnqAQKeMTjRgXVzOpDkOc= Received: from [192.168.1.64] ([76.240.47.196]) by mail-03.name-services.com with Microsoft SMTPSVC(6.0.3790.4675); Tue, 6 Sep 2011 16:41:44 -0700 Message-ID: <4E66AFBC.4040501@a1poweruser.com> Date: Tue, 06 Sep 2011 19:41:48 -0400 From: Fbsd8 User-Agent: Thunderbird 2.0.0.17 (Windows/20080914) MIME-Version: 1.0 To: h h References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 06 Sep 2011 23:41:44.0938 (UTC) FILETIME=[895B4CA0:01CC6CEE] X-Sender: fbsd8@a1poweruser.com X-Envelope-From: fbsd8*a1poweruser.com 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 List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Sep 2011 23:58:45 -0000 > >> 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? > > Did you copy under root? BSD cpio unlike GNU cpio does preserve file flags. > > $ cpio --version > bsdcpio 2.8.4 -- libarchive 2.8.4 > > $ find /lib | sudo cpio -dmp test > 56525 blocks > > $ ls -lo test/lib | awk '$5 != "-"' > total 15595 > -r--r--r-- 1 root wheel schg 4440677 Sep 5 22:24 libc.so.7 > -r--r--r-- 1 root wheel schg 131655 Sep 5 22:24 libcrypt.so.5 > -r--r--r-- 1 root wheel schg 592241 Sep 5 22:24 libthr.so.3 > I am running release 8.2 and $ cpio --version returns bsdcpio 2.7.0 -- libarchive 2.7.0 This version seems not to copy the schg flag maybe cpio got upgraded in release 9.0 which you must be running.