This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
fileservices:copy_acls [2013/06/25 06:29] tschulz created |
fileservices:copy_acls [2013/06/25 08:11] (current) tschulz [Copy ACLs all items in a directory] |
||
---|---|---|---|
Line 2: | Line 2: | ||
<file> | <file> | ||
getfacl file1 | setfacl --set-file=- file2 | getfacl file1 | setfacl --set-file=- file2 | ||
+ | </file> | ||
+ | |||
+ | ===== Copy ACLs all items in a directory ===== | ||
+ | <file bash acl.sh> | ||
+ | #!/bin/sh | ||
+ | |||
+ | LIST="`cd /vol1/public/Data && ls | sed \"s/ /_/g\"`" | ||
+ | |||
+ | for i in $LIST | ||
+ | do | ||
+ | ITEM="`echo $i | sed \"s/_/ /g\"`" | ||
+ | getfacl /vol1/public/Data/"$ITEM" | setfacl --set-file=- /vol2/public/Data/"$ITEM" | ||
+ | done | ||
</file> | </file> |