Posté par chboeuf le 24 septembre 2007 à 10:19. En réponse au message chown récursif avec exclusion de répertoire. Évalué à 0.
Posté par chboeuf le 24 septembre 2007 à 10:17. En réponse au message chown récursif avec exclusion de répertoire. Évalué à 1.
Posté par chboeuf le 21 septembre 2007 à 17:08. En réponse au message chown récursif avec exclusion de répertoire. Évalué à 1.
Posté par chboeuf le 21 septembre 2007 à 16:51. En réponse au message chown récursif avec exclusion de répertoire. Évalué à 1.
[^] # Re: Juste find.
Posté par chboeuf . En réponse au message chown récursif avec exclusion de répertoire. Évalué à 0.
Tout est en root:
[root@ww-noitst15 miles]# ls -la
drwxr-xr-x 4 root root 4096 sep 24 10:02 .
drwxr-xr-x 4 root root 4096 sep 24 10:02 ..
-rw-r--r-- 1 root root 191881 sep 24 10:02 jaxen-full.jar
-rw-r--r-- 1 root root 147698 sep 24 10:02 jdom.jar
-rwxr-x--- 1 root root 21629 sep 24 10:02 local.properties
-rw-r--r-- 1 root root 1739 sep 24 10:00 log4j.properties
drwxr-xr-x 13 root root 4096 sep 24 10:02 MilesRoot
-rwxr-xr-x 1 root root 1352918 sep 24 10:02 ojdbc14.jar
Passage de la commande. MilesRoot a changé de propriétaire.
[root@ww-noitst15 miles]# find ./MilesRoot -not -regex '^./MilesRoot/report*' -exec chown exploit:dba {} \;
[root@ww-noitst15 miles]# ls -la
drwxr-xr-x 4 root root 4096 sep 24 10:02 .
drwxr-xr-x 4 root root 4096 sep 24 10:02 ..
-rw-r--r-- 1 root root 191881 sep 24 10:02 jaxen-full.jar
-rw-r--r-- 1 root root 147698 sep 24 10:02 jdom.jar
-rwxr-x--- 1 root root 21629 sep 24 10:02 local.properties
-rw-r--r-- 1 root root 1739 sep 24 10:00 log4j.properties
drwxr-xr-x 13 exploit dba 4096 sep 24 10:02 MilesRoot
-rwxr-xr-x 1 root root 1352918 sep 24 10:02 ojdbc14.jar
Le répertoire report n'a pas subit le chown --> normal
[root@ww-noitst15 miles]# cd MilesRoot/
[root@ww-noitst15 MilesRoot]# ls -la
drwxr-xr-x 13 exploit dba 4096 sep 24 10:02 .
drwxr-xr-x 4 root root 4096 sep 24 10:02 ..
drwxr-xr-x 5 exploit dba 4096 sep 24 10:00 batch
drwxr-xr-x 3 exploit dba 4096 sep 24 10:00 command
drwxr-xr-x 95 exploit dba 16384 sep 24 10:02 connectors
drwxr-xr-x 7 exploit dba 102400 sep 24 10:00 documents
drwxr-xr-x 5 exploit dba 4096 sep 24 10:00 milesweb
drwxr-xr-x 3 exploit dba 4096 sep 24 10:02 policy
drwxr-x--- 3 root root 4096 sep 24 10:02 report
drwxr-xr-x 2 exploit dba 4096 sep 24 10:00 schema
-rwxr-xr-x 1 exploit dba 3990100 sep 24 10:00 userStatistics.csv
Son contenu a subit le changement.
[root@ww-noitst15 report]# ls -la
drwxr-x--- 3 root root 4096 sep 24 10:02 .
drwxr-xr-x 13 exploit dba 4096 sep 24 10:02 ..
drwxr-x--- 2 exploit dba 4096 sep 24 10:02 2007_06
-rwxr-x--- 1 exploit dba 0 sep 24 10:02 test.log
Je tourne sur une Red Hat ES 4.
[^] # Re: Juste find.
Posté par chboeuf . En réponse au message chown récursif avec exclusion de répertoire. Évalué à 1.
Tout est en root:
[root@ww-noitst15 miles]# ls -la
drwxr-xr-x 4 root root 4096 sep 24 10:02 .
drwxr-xr-x 4 root root 4096 sep 24 10:02 ..
-rw-r--r-- 1 root root 191881 sep 24 10:02 jaxen-full.jar
-rw-r--r-- 1 root root 147698 sep 24 10:02 jdom.jar
-rwxr-x--- 1 root root 21629 sep 24 10:02 local.properties
-rw-r--r-- 1 root root 1739 sep 24 10:00 log4j.properties
drwxr-xr-x 13 root root 4096 sep 24 10:02 MilesRoot
-rwxr-xr-x 1 root root 1352918 sep 24 10:02 ojdbc14.jar
Passage de la commande. MilesRoot a changé de propriétaire.
[root@ww-noitst15 miles]# find ./MilesRoot -not -regex '^./MilesRoot/report*' -exec chown exploit:dba {} \;
[root@ww-noitst15 miles]# ls -la
total 5528
drwxr-xr-x 4 root root 4096 sep 24 10:02 .
drwxr-xr-x 4 root root 4096 sep 24 10:02 ..
-rw-r--r-- 1 root root 191881 sep 24 10:02 jaxen-full.jar
-rw-r--r-- 1 root root 147698 sep 24 10:02 jdom.jar
-rwxr-x--- 1 root root 21629 sep 24 10:02 local.properties
-rw-r--r-- 1 root root 1739 sep 24 10:00 log4j.properties
drwxr-xr-x 13 exploit dba 4096 sep 24 10:02 MilesRoot
-rwxr-xr-x 1 root root 1352918 sep 24 10:02 ojdbc14.jar
Le répertoire report n'a pas subit le chown --> normal
[root@ww-noitst15 miles]# cd MilesRoot/
[root@ww-noitst15 MilesRoot]# ls -la
drwxr-xr-x 13 exploit dba 4096 sep 24 10:02 .
drwxr-xr-x 4 root root 4096 sep 24 10:02 ..
drwxr-xr-x 5 exploit dba 4096 sep 24 10:00 batch
drwxr-xr-x 3 exploit dba 4096 sep 24 10:00 command
drwxr-xr-x 95 exploit dba 16384 sep 24 10:02 connectors
drwxr-xr-x 7 exploit dba 102400 sep 24 10:00 documents
drwxr-xr-x 5 exploit dba 4096 sep 24 10:00 milesweb
drwxr-xr-x 3 exploit dba 4096 sep 24 10:02 policy
drwxr-x--- 3 root root 4096 sep 24 10:02 report
drwxr-xr-x 2 exploit dba 4096 sep 24 10:00 schema
-rwxr-xr-x 1 exploit dba 3990100 sep 24 10:00 userStatistics.csv
Son contenu a subit le changement.
[root@ww-noitst15 report]# ls -la
drwxr-x--- 3 root root 4096 sep 24 10:02 .
drwxr-xr-x 13 exploit dba 4096 sep 24 10:02 ..
drwxr-x--- 2 exploit dba 4096 sep 24 10:02 2007_06
-rwxr-x--- 1 exploit dba 0 sep 24 10:02 test.log
Je tourne sur une Red Hat ES 4.
[^] # Re: chown récursif avec exclusion de répertoire
Posté par chboeuf . En réponse au message chown récursif avec exclusion de répertoire. Évalué à 1.
La commande ne marche pas correctement car je peux avoir d'autres répertoires dont le nom commence par la lettre "r".
Mais tu ne pouvais pas le savoir, je ne l'ai pas précisé.
Merci en tout cas.
[^] # Re: Juste find.
Posté par chboeuf . En réponse au message chown récursif avec exclusion de répertoire. Évalué à 1.
La commande fonctionne bien mais si j'ai une arborescence dans report, l'arborescence subira le chown.
Résultat, obligé de faire un
find ./MilesRoot -not -regex '^./MilesRoot/report*.*.*' -exec chown nlaccept:nlaccept {} \;
Si je veux exclure 3 niveaux hiérarchiques du répertoire report. Et comme je ne peux savoir à l'avance la "profondeur" de ce répertoire, y a t'il moyen de rendre ca dynamique ?
Merci d'avance