Date: Tue, 06 Sep 2011 19:41:48 -0400 From: Fbsd8 <fbsd8@a1poweruser.com> To: h h <aakuusta@gmail.com> Cc: "Questions@Freebsd. Org" <questions@freebsd.org> Subject: Re: cpio command and schg flags Message-ID: <4E66AFBC.4040501@a1poweruser.com> In-Reply-To: <NBECLJEKGLBKHHFFANMBCEFACPAA.joeb1@a1poweruser.com> References: <NBECLJEKGLBKHHFFANMBCEFACPAA.joeb1@a1poweruser.com>
next in thread | previous in thread | raw e-mail | index | archive | help
> >> 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.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4E66AFBC.4040501>