Operating System - HP-UX
1834628 Members
2780 Online
110069 Solutions
New Discussion

to copy acl's for a directory and all subdirectories and files below

 
SOLVED
Go to solution
Varghese Mathew
Trusted Contributor

to copy acl's for a directory and all subdirectories and files below

Can anyone tell me how to copy acl's for a directory and all subdirectories and files below?. We have a specific directory which has a number of subdirectories and many files with different acl attributes throughout. I wish if i can automate this rather than having to do it manually. FS type is HFS. OS version is 10.20

Thanx in advance
Cheers !!!
Mathew
Cheers !!!
2 REPLIES 2
Rainer von Bongartz
Honored Contributor

Re: to copy acl's for a directory and all subdirectories and files below

use chacl -f
you can cobine this with a find command and a simple script

create file cpacl with the following line
chacl -f $1 /newdir/$1

find /dir -xargs cpacl

regards
Rainer
He's a real UNIX Man, sitting in his UNIX LAN making all his UNIX plans for nobody ...
eran maor
Honored Contributor
Solution

Re: to copy acl's for a directory and all subdirectories and files below

Hi

i saw in the menuals the fbackup is backuping by default the ACL .

if you are using the option -A it will not backup the acls but i never try it .

but i think that fbackup is the best command that you can use .

man page :
-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 ACL to be recovered
on a system that does not understand ACL (see acl(5)).
love computers