[OpenAFS] Setting ACL´s in recursive
directories.
Rogelio Bazán Reyes
rogbazan@bsantander.com.mx
Thu, 17 Jul 2003 08:45:39 -0500
--Boundary_(ID_L+eBM3AXdcRc/tGH+0NJJA)
Content-type: text/plain; format=flowed; charset=ISO-8859-1
Content-transfer-encoding: QUOTED-PRINTABLE
I have the following script, but if the directory tree is too big, it=
=20
fails...i suppose to that is the possible cause. Check it.
regards
#!/bin/sh
# the next line restarts using tclsh \
exec /afs/invermexico.com.mx/sun4x_55/usr/gnu/bin/tclsh "$0" "$@"
if {$argc < 2} {
puts "Uso: [file tail $argv0] <usuario> <permisos>"
exit
}
#####################################################################=
##
#
# Procedimiento: GetDirectories
#
# Proposito : Este procedimiento recursivo almacena en la variable
# global "dirlist" la lista de todos los directorios que
# esten debajo del directorio "currdir".
#
#####################################################################=
##
proc GetDirectories {currdir} {
global dirlist
set filelist [glob -nocomplain $currdir]
set loclist {}
foreach f $filelist {
if {[file isdirectory $f] !=3D 0 && [file tail $f] !=3D "OldFiles=
" && \
[file tail $f] !=3D "wabi"} {
lappend loclist $f
lappend dirlist $f
}
}
=20
foreach f $loclist {
GetDirectories $f/*
}
}
#####################################################################=
##
#
# M A I N F U N C T I O N
#
#####################################################################=
##
set dirlist {}
GetDirectories ./*
lappend dirlist .
set usuario [lindex $argv 0]
set permisos [lindex $argv 1]
foreach f $dirlist {
puts "fs sa $f $usuario $permisos"
exec fs sa $f $usuario $permisos
}
Douglas E. Engert wrote:
>Rogelio Baz=E1n Reyes wrote:
> =20
>
>>Do you know how to set permissions recursively on a directory tree?
>> =20
>>
>
>find . -type d -exec fs sa {} -acl xxxxxxx xxxx \; -print
>
> =20
>
>>thanks
>>
>>_______________________________________________
>>OpenAFS-info mailing list
>>OpenAFS-info@openafs.org
>>https://lists.openafs.org/mailman/listinfo/openafs-info
>> =20
>>
>
> =20
>
--=20
---------------------------------------
Rogelio Baz=E1n Reyes
Grupo Financiero Santander Serf=EDn
Soporte T=E9cnico a Redes Locales.
Tel. 51741100ext.19321 o dir. 51741953
---------------------------------------
--Boundary_(ID_L+eBM3AXdcRc/tGH+0NJJA)
Content-type: text/html; charset=us-ascii
Content-transfer-encoding: QUOTED-PRINTABLE
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv=3D"Content-Type" content=3D"text/html;charset=3DIS=
O-8859-1">
<title></title>
</head>
<body>
I have the following script, but if the directory tree is too big, it=
fails...i
suppose to that is the possible cause. Check it.<br>
regards<br>
<br>
#!/bin/sh<br>
# the next line restarts using tclsh \<br>
exec /afs/invermexico.com.mx/sun4x_55/usr/gnu/bin/tclsh "$0" "$@"<br>
<br>
if {$argc < 2} {<br>
puts "Uso: [file tail $argv0] <usuario> <=
permisos>"<br>
exit<br>
}<br>
<br>
#####################################################################=
##<br>
#<br>
# Procedimiento: GetDirectories<br>
#<br>
# Proposito : Este procedimiento recursivo almacena en la variable<br=
>
# &n=
bsp; global "dirlist" la lista de todos los directorios que<br>
# &n=
bsp; esten debajo del directorio "currdir".<br>
#<br>
#####################################################################=
##<br>
<br>
proc GetDirectories {currdir} {<br>
global dirlist<br>
<br>
set filelist [glob -nocomplain $currdir]<br>
set loclist {}<br>
<br>
foreach f $filelist {<br>
if {[file isdirectory $f] !=3D 0 && [file =
tail $f] !=3D "OldFiles"
&& \<br>
[file tail $f] !=3D "wabi"} {<b=
r>
lappend loclist $f<br>
lappend dirlist $f<br>
}<br>
}<br>
<br>
foreach f $loclist {<br>
GetDirectories $f/*<br>
}<br>
}<br>
<br>
#####################################################################=
##<br>
#<br>
# =
M A I N F U N C T I O N<br>
#<br>
#####################################################################=
##<br>
<br>
set dirlist {}<br>
GetDirectories ./*<br>
lappend dirlist .<br>
set usuario [lindex $argv 0]<br>
set permisos [lindex $argv 1]<br>
<br>
foreach f $dirlist {<br>
puts "fs sa $f $usuario $permisos"<br>
exec fs sa $f $usuario $permisos<br>
}<br>
<br>
<br>
Douglas E. Engert wrote:<br>
<blockquote type=3D"cite" cite=3D"mid3F15A494.7EEC3419@anl.gov">
<pre wrap=3D"">
Rogelio Bazán Reyes wrote:
</pre>
<blockquote type=3D"cite">
<pre wrap=3D"">Do you know how to set permissions recursively on =
a directory tree?
</pre>
</blockquote>
<pre wrap=3D""><!---->
find . -type d -exec fs sa {} -acl xxxxxxx xxxx \; -print
</pre>
<blockquote type=3D"cite">
<pre wrap=3D"">thanks
_______________________________________________
OpenAFS-info mailing list
<a class=3D"moz-txt-link-abbreviated" href=3D"mailto:OpenAFS-info@ope=
nafs.org">OpenAFS-info@openafs.org</a>
<a class=3D"moz-txt-link-freetext" href=3D"https://lists.openafs.org/=
mailman/listinfo/openafs-info">https://lists.openafs.org/mailman/list=
info/openafs-info</a>
</pre>
</blockquote>
<pre wrap=3D""><!---->
</pre>
</blockquote>
<br>
<pre class=3D"moz-signature" cols=3D"$mailwrapcol">--=20
---------------------------------------
Rogelio Bazán Reyes
Grupo Financiero Santander Serfín
Soporte Técnico a Redes Locales.
Tel. 51741100ext.19321 o dir. 51741953
---------------------------------------
</pre>
<br>
</body>
</html>
--Boundary_(ID_L+eBM3AXdcRc/tGH+0NJJA)--