Pagina 1 di 1

Cambiare permessi SOLO di files

Inviato: 12 nov 2008, 09:40
da fudu
Avrei bisogno di modificare i permessi solo dei file contenuti un una cartella e NON delle directory
Ho provato, con putty

find . -type f -exec chmod xxx {} \;


ma ricevo questo messaggio:


BusyBox v1.01 (2008.09.03-19:03+0000) multi-call binary

Usage: find [PATH...] [EXPRESSION]

Search for files in a directory hierarchy. The default PATH is
the current directory; default EXPRESSION is '-print'

EXPRESSION may consist of:
-follow Dereference symbolic links.
-name PATTERN File name (leading directories removed) matches PATTERN.
-print Print (default and assumed).

-type X Filetype matches X (where X is one of: f,d,l,b,c,...)
-perm PERMS Permissions match any of (+NNN); all of (-NNN);
or exactly (NNN)
-mtime TIME Modified time is greater than (+N); less than (-N);
or exactly (N) days


Qualche suggerimento??

Re: Cambiare permessi SOLO di files

Inviato: 12 nov 2008, 11:15
da luciano
Ciao fudu, ad occhio direi che c'è un errore nella tua espressione, mi sembra che manchi il "cosa" nel predicato del find, dovrebbe essere:
find . "xxx" -type f -exec chmod 744 {} \;
trova (find) da dove ti trovi ora (.) questa cosa ("xxx") del tipo file (-type f) ed esegui (-exec) etc.etc.

N.B. occhio alle virgolette xchè mi pare di ricordare che in questo tipo di predicato ci vogliano nello specificare l'oggetto della ricerca.

Non posso commentare sul fatto se l'espressione faccia quello che ti serve xchè non mi è del tutto chiaro cosa devi fare di preciso.

HTH

Re: Cambiare permessi SOLO di files

Inviato: 12 nov 2008, 16:54
da fudu
luciano ha scritto:Ciao fudu, ad occhio direi che c'è un errore nella tua espressione, mi sembra che manchi il "cosa" nel predicato del find, dovrebbe essere:
find . "xxx" -type f -exec chmod 744 {} \;
trova (find) da dove ti trovi ora (.) questa cosa ("xxx") del tipo file (-type f) ed esegui (-exec) etc.etc.

N.B. occhio alle virgolette xchè mi pare di ricordare che in questo tipo di predicato ci vogliano nello specificare l'oggetto della ricerca.

Non posso commentare sul fatto se l'espressione faccia quello che ti serve xchè non mi è del tutto chiaro cosa devi fare di preciso.

HTH
No, il comando è giusto, se lancio il comando senza la parte -exec chmod 744 {} \; da come risultato in effetti tutti i file.
Però non li passa ad exec, sembra che non lo riconosca come opzione possibile...

Re: Cambiare permessi SOLO di files

Inviato: 12 nov 2008, 17:41
da luciano
E' esattamente quello che intendo: da solo funziona ma in quel costrutto che hai indicato devi modificare come ti ho detto.

Prova anche cosi:

Codice: Seleziona tutto

find . "*" -type f -exec chmod 744 {} \;

Re: Cambiare permessi SOLO di files

Inviato: 12 nov 2008, 17:59
da fudu
luciano ha scritto:E' esattamente quello che intendo: da solo funziona ma in quel costrutto che hai indicato devi modificare come ti ho detto.

Prova anche cosi:
find . "*" -type f -exec chmod 744 {} \;
no, niente da fare, da lo stesso risultato...

Re: Cambiare permessi SOLO di files

Inviato: 12 nov 2008, 18:09
da luciano
Con Solaris funziona cosi, forse è un limite di BusyBox. Faccio una googlata e ti dico.

Re: Cambiare permessi SOLO di files

Inviato: 12 nov 2008, 18:17
da luciano
su BusyBox:


find
find [PATH...] [EXPRESSION]

Search for files. The default PATH is the current directory, default EXPRESSION is '-print'

EXPRESSION may consist of:

-follow Dereference symlinks
-xdev Don't descend directories on other filesystems
-maxdepth N Descend at most N levels. -maxdepth 0 applies
tests/actions to command line arguments only
-name PATTERN File name (w/o directory name) matches PATTERN
-iname PATTERN Case insensitive -name
-path PATTERN Path matches PATTERN
-regex PATTERN Path matches regex PATTERN
-type X File type is X (X is one of: f,d,l,b,c,...)
-perm NNN Permissions match any of (+NNN), all of (-NNN),
or exactly (NNN)
-mtime DAYS Modified time is greater than (+N), less than (-N),
or exactly (N) days
-mmin MINS Modified time is greater than (+N), less than (-N),
or exactly (N) minutes
-newer FILE Modified time is more recent than FILE's
-inum N File has inode number N
-user NAME File is owned by user NAME (numeric user ID allowed)
-group NAME File belongs to group NAME (numeric group ID allowed)
-depth Process directory name after traversing it
-size N[bck] File size is N (c:bytes,k:kbytes,b:512 bytes(def.)).
+/-N: file size is bigger/smaller than N
-print Print (default and assumed)
-print0 Delimit output with null characters rather than
newlines USE_FEATURE_FIND_CONTEXT (
-context File has specified security context")
-exec CMD ARG ; Execute CMD with all instances of {} replaced by the matching files

Re: Cambiare permessi SOLO di files

Inviato: 14 nov 2008, 16:15
da fudu
luciano ha scritto:su BusyBox:


find
find [PATH...] [EXPRESSION]

Search for files. The default PATH is the current directory, default EXPRESSION is '-print'

EXPRESSION may consist of:

-follow Dereference symlinks
-xdev Don't descend directories on other filesystems
-maxdepth N Descend at most N levels. -maxdepth 0 applies
tests/actions to command line arguments only
-name PATTERN File name (w/o directory name) matches PATTERN
-iname PATTERN Case insensitive -name
-path PATTERN Path matches PATTERN
-regex PATTERN Path matches regex PATTERN
-type X File type is X (X is one of: f,d,l,b,c,...)
-perm NNN Permissions match any of (+NNN), all of (-NNN),
or exactly (NNN)
-mtime DAYS Modified time is greater than (+N), less than (-N),
or exactly (N) days
-mmin MINS Modified time is greater than (+N), less than (-N),
or exactly (N) minutes
-newer FILE Modified time is more recent than FILE's
-inum N File has inode number N
-user NAME File is owned by user NAME (numeric user ID allowed)
-group NAME File belongs to group NAME (numeric group ID allowed)
-depth Process directory name after traversing it
-size N[bck] File size is N (c:bytes,k:kbytes,b:512 bytes(def.)).
+/-N: file size is bigger/smaller than N
-print Print (default and assumed)
-print0 Delimit output with null characters rather than
newlines USE_FEATURE_FIND_CONTEXT (
-context File has specified security context")
-exec CMD ARG ; Execute CMD with all instances of {} replaced by the matching files
Ho scoperto l'inghippo...
Mi ha risposto il support tecnico QNAP e mi dice che....

"Our NAS doesn’t support file level permissions. Changing file permissions may cause unexpected problem.
Besides, -exec option is not supported on our NAS find command. "

... ho ricreato le cartelle e ritrasferito tutto...

Re: Cambiare permessi SOLO di files

Inviato: 14 nov 2008, 17:48
da luciano
Ottimo, grazie per averlo riportato, credo sarà utile ad altri come futuro riferimento, me compreso! 8-)

Re: Cambiare permessi SOLO di files

Inviato: 03 nov 2009, 09:24
da Pr3ssure
ad oggi non è stata ancor aimplementata questa funzione ?

HO cercato e sto cercando un po' in giro cercando di capire anche come samba possa agire su questa cosa
avete ragguagli ?!

CIao ciao