1848132 Members
7931 Online
104022 Solutions
New Discussion

Re: Saving Defined ACL's

 
Richard Ross
Regular Advisor

Saving Defined ACL's

Is there a way to collect all the ACL's that are defined to the system (via getacl) so we could have the ability to restore (via a setacl). Want to play it safe for Disaster Recovery. This is for HP/UX 11.0 (JFS 3.3), 11.11 and 11.23

Thanks
6 REPLIES 6
Peter Godron
Honored Contributor

Re: Saving Defined ACL's

Richard,
man fbackup
gives you:
"
-A Do not back up optional entries of access control lists
(ACLs) for files. Normally, all mode information is
backed up including the optional ACL entries. With the
-A option, the summary mode information (as returned by
stat()) is backed up. Use this option when backing up
files from a system that contains ACLs to be recovered
on a system that does not understand ACLs (see acl(5)).
"
So fbackup would have a copy of your ACL.
Richard Ross
Regular Advisor

Re: Saving Defined ACL's

Peter .. Thanks, but I was thinking more standalone .. we do not use fbackup.
Peter Godron
Honored Contributor

Re: Saving Defined ACL's

Richard,
as a last resort:
cd /
find / -exec getacl {} \; > /tmp/acls.lis

This will search all files on the machine and execute a getacl, dumping the output into a file.
You could then use that file to extract the information required for setacl.

Rather messy and I am sure somebody else will have a better idea.
Richard Ross
Regular Advisor

Re: Saving Defined ACL's

Well .. After looking into more detail .. looks like the following will work:

find / -aclv opt | xargs getacl

My problem is I need to perform this on Linux and AIX and those platforms don't support the -aclv param on find. But one down and 2 to go

Thanks
Peter Godron
Honored Contributor

Re: Saving Defined ACL's

Richard,
happy the find command set you on the way.

Probably best to close this thread and raise new ones in the relevant fora.
Richard Ross
Regular Advisor

Re: Saving Defined ACL's

find / -aclv opt | xargs getacl

Will do the job .. Thanks for the help