[WBEL-users] Re: [CentOS] check permissions of all my files! -- find example, short script (Last Comment)

Bryan J. Smith b.j.smith at ieee.org
Tue May 17 16:14:19 CDT 2005

On Tue, 2005-05-17 at 15:57 -0500, Bryan J. Smith wrote:
> Also, there is a way to save/apply ACLs as well (using getfacl/setfacl).
> I've been using a variant of this script to save all ACLs into a script
> when backing up, just in case the backup approach doesn't save them
> (e.g., I typically limit my use of ACLs to XFS, because xfsdump
> preserves them, but just in case I use something that cant').

Of course, another option instead of using my script (but is more Linux-
centric, not sure if it's SUS v3 / POSIX 100x-2001 compliant, let alone
it probably doesn't work on other UNIX flavors) is to just use the
"getfacl/setfacl" commands directly -- not only for ACLs, but regular
UNIX permissions as well.

  $ getfacl -R /abspath > /abspath.acls # Saves UNIX+ACL to file
  $ setfacl --restore=/abspath.acls # Restores UNIX+ACL from file

My older scripts for ACLs were designed for cross-Linux/Irix with XFS.
This seems to work on Linux (I haven't tried older Irix versions),
and possibly any UNIX post-SUSv3/POSIX100x-2001.

Bryan J. Smith                                 b.j.smith at ieee.org 
Beware of those who define their preference in terms of hate of
another option, and not on the positive merits of their selection

More information about the Whitebox-users mailing list