Re: cpio command and schg flags

2011-09-07 Thread Jerry
On Tue, 06 Sep 2011 19:41:48 -0400
Fbsd8 articulated:

> 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.

$ uname -rm
8.2-STABLE amd64

$ cpio --version
bsdcpio 2.8.4 -- libarchive 2.8.4

-- 
Jerry ✌
jerry+f...@seibercom.net

Disclaimer: off-list followups get on-list replies or ignored.
Do not CC this poster. Please do not ignore the "Reply-To" header.

http://www.catb.org/~esr/faqs/smart-questions.html
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: cpio command and schg flags

2011-09-06 Thread Fbsd8





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.

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


FW: cpio command and schg flags

2011-09-06 Thread joeb1


> 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

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: cpio command and schg flags

2011-09-05 Thread Carl Johnson
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 Johnsonca...@peak.org

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: cpio command and schg flags

2011-09-05 Thread Polytropon
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, ...
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


cpio command and schg flags

2011-09-05 Thread joeb1
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?

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"