Is there a fast way to get acl's for the whole filesystem (or chunk thereof)

2009-11-05 Thread aputerguy

For backup, I am trying to dump a list of the acl's for the files being
backed up since my backup program doesn't handle the acls.

When I use something like:
   find /c -exec getfacl {} \;  mysavefile

It is slow, in part at least because it has to fork a call to getfacl on
each file found.
Is there a faster way to do this (hopefully without having to go write
C-code)?
-- 
View this message in context: 
http://old.nabble.com/Is-there-a-fast-way-to-get-acl%27s-for-the-whole-filesystem-%28or-chunk-thereof%29-tp26222793p26222793.html
Sent from the Cygwin list mailing list archive at Nabble.com.


--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Re: Is there a fast way to get acl's for the whole filesystem (or chunk thereof)

2009-11-05 Thread Larry Hall (Cygwin)

On 11/05/2009 05:00 PM, aputerguy wrote:


For backup, I am trying to dump a list of the acl's for the files being
backed up since my backup program doesn't handle the acls.

When I use something like:
find /c -exec getfacl {} \;  mysavefile

It is slow, in part at least because it has to fork a call to getfacl on
each file found.
Is there a faster way to do this (hopefully without having to go write
C-code)?


find /c -exec getfacl {} \+  mysavefile

?

--
Larry Hall  http://www.rfk.com
RFK Partners, Inc.  (508) 893-9779 - RFK Office
216 Dalton Rd.  (508) 893-9889 - FAX
Holliston, MA 01746

_

A: Yes.
 Q: Are you sure?
 A: Because it reverses the logical flow of conversation.
 Q: Why is top posting annoying in email?

--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Re: Is there a fast way to get acl's for the whole filesystem (or chunk thereof)

2009-11-05 Thread Dave Korn
aputerguy wrote:
 For backup, I am trying to dump a list of the acl's for the files being
 backed up since my backup program doesn't handle the acls.
 
 When I use something like:
find /c -exec getfacl {} \;  mysavefile
 
 It is slow, in part at least because it has to fork a call to getfacl on
 each file found.

  Don't use -exec; use -print0 and pipe the output to xargs -0 getfacl.

cheers,
  DaveK

--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Re: Is there a fast way to get acl's for the whole filesystem (or chunk thereof)

2009-11-05 Thread Andrew Schulman
 
 For backup, I am trying to dump a list of the acl's for the files being
 backed up since my backup program doesn't handle the acls.
 
 When I use something like:
find /c -exec getfacl {} \;  mysavefile
 
 It is slow, in part at least because it has to fork a call to getfacl on
 each file found.
 Is there a faster way to do this (hopefully without having to go write
 C-code)?

getfacl -R?


--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Re: Is there a fast way to get acl's for the whole filesystem (or chunk thereof)

2009-11-05 Thread Dave Korn
Andrew Schulman wrote:
 For backup, I am trying to dump a list of the acl's for the files being
 backed up since my backup program doesn't handle the acls.

 When I use something like:
find /c -exec getfacl {} \;  mysavefile

 It is slow, in part at least because it has to fork a call to getfacl on
 each file found.
 Is there a faster way to do this (hopefully without having to go write
 C-code)?
 
 getfacl -R?

  I think you're guessing.  There's no -R option in the getfacl --help
output and it got rejected when I tried it just in case.

cheers,
  DaveK


--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Re: Is there a fast way to get acl's for the whole filesystem (or chunk thereof)

2009-11-05 Thread aputerguy


Andrew Schulman-3 wrote:
 getfacl -R?

Unfortunately, no '-R' at least on my updated version.

The -exec ... \+ and the -print0 | xargs -0 tricks both worked!!!
Thanks.

Timing and comparing the two approaches, it seems like they both use the
same 'user' time but the xargs approach uses only about half the 'system'
time.
-- 
View this message in context: 
http://old.nabble.com/Is-there-a-fast-way-to-get-acl%27s-for-the-whole-filesystem-%28or-chunk-thereof%29-tp26222793p26226433.html
Sent from the Cygwin list mailing list archive at Nabble.com.


--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Re: Is there a fast way to get acl's for the whole filesystem (or chunk thereof)

2009-11-05 Thread aputerguy

OK... one small problem.
Every ~4500 lines and (70-80K characters), both of these methods omit the
empty line between the getfacl stanzas. The skipped lines however don't
occur at the same places in the two different methods.

I assume it must be due to buffering of the long line input or something,
but I would like to correct for it.
Preferably correct it before it occurs rather than having to use some sed or
perl magic to clean up the file afterward.

Any suggestions?
-- 
View this message in context: 
http://old.nabble.com/Is-there-a-fast-way-to-get-acl%27s-for-the-whole-filesystem-%28or-chunk-thereof%29-tp26222793p26226546.html
Sent from the Cygwin list mailing list archive at Nabble.com.


--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Re: Is there a fast way to get acl's for the whole filesystem (or chunk thereof)

2009-11-05 Thread Larry Hall (Cygwin)

On 11/05/2009 11:05 PM, aputerguy wrote:


OK... one small problem.
Every ~4500 lines and (70-80K characters), both of these methods omit the
empty line between the getfacl stanzas. The skipped lines however don't
occur at the same places in the two different methods.

I assume it must be due to buffering of the long line input or something,
but I would like to correct for it.
Preferably correct it before it occurs rather than having to use some sed or
perl magic to clean up the file afterward.

Any suggestions?


$ getfacl ~/.vim/colors/mine.vim; getfacl ~/.bash_history; getfacl.exe /tmp/tt
# file: /home/lhall/.vim/colors/mine.vim
# owner: lhall
# group: None
user::rwx
group::---
mask:rwx
other:---
# file: /home/lhall/.bash_history
# owner: lhall
# group: None
user::rw-
group::---
mask:rwx
other:---
# file: /tmp/tt
# owner: lhall
# group: None
user::rw-
group::r--
mask:rwx
other:r--

What empty line between the getfacls stanzas?

--
Larry Hall  http://www.rfk.com
RFK Partners, Inc.  (508) 893-9779 - RFK Office
216 Dalton Rd.  (508) 893-9889 - FAX
Holliston, MA 01746

_

A: Yes.
 Q: Are you sure?
 A: Because it reverses the logical flow of conversation.
 Q: Why is top posting annoying in email?

--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Re: Is there a fast way to get acl's for the whole filesystem (or chunk thereof)

2009-11-05 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

According to Larry Hall (Cygwin) on 11/5/2009 9:13 PM:
 What empty line between the getfacls stanzas?

The blank line that is output after one getfacl process ends.  Try
'getfacl . .; getfacl .' vs. 'getfacl .; getfacl . .' to see it.

The number of command line arguments pieced together without exceeding
exec() limits is dependent on the sum of the command line length and the
size of the current environment; but since the 'find -exec {} +' and 'find
- -print0 | xargs -0' approaches see a slightly different environment
variables (in particular, $_ will be a different length between the two
invocations), the wraparound point for creating new processes differs.

But if you WANT to guarantee a newline between processes, just ask for it.
 Here's one way:

find -print0 | xargs -0 sh -c 'getfacl $@; echo' sh

- --
Don't work too hard, make some time for fun as well!

Eric Blake e...@byu.net
volunteer cygwin findutils maintainer
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkrzsOYACgkQ84KuGfSFAYBtygCfdRcDiCdFIruAygjweoT6OOM0
c08An1Vi3xPHMP9Y6ID+0O7WITkmPn7H
=5Svy
-END PGP SIGNATURE-

--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Re: Is there a fast way to get acl's for the whole filesystem (or chunk thereof)

2009-11-05 Thread Andrew Schulman
 Andrew Schulman wrote:
  For backup, I am trying to dump a list of the acl's for the files being
  backed up since my backup program doesn't handle the acls.
 
  When I use something like:
 find /c -exec getfacl {} \;  mysavefile
 
  It is slow, in part at least because it has to fork a call to getfacl on
  each file found.
  Is there a faster way to do this (hopefully without having to go write
  C-code)?
  
  getfacl -R?
 
   I think you're guessing.  There's no -R option in the getfacl --help
 output and it got rejected when I tried it just in case.

Well, only partly.  I was looking at getfacl on my Debian box at home, and it
does have an -R option for recursive retrieval.  Strange that Cygwin doesn't
have it.


--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple