1 | #!/bin/bash |
---|
2 | |
---|
3 | echo "Quel est votre login sur Ciclad " |
---|
4 | echo -n "Votre reponse : " |
---|
5 | read loginCiclad |
---|
6 | |
---|
7 | |
---|
8 | cd /ccc/work/cont003/igcmg/igcmg |
---|
9 | |
---|
10 | echo " Resultat du rsync en dry-run : " |
---|
11 | echo "" |
---|
12 | rsync -n --omit-dir-times -vrltgoD --progress --delete -e "ssh -ax -o ClearAllForwardings=yes -c blowfish" --exclude='CMIP6/*' --exclude='suivi-de-consomation/*' IGCM/ ${loginCiclad}@ciclad.ipsl.jussieu.fr:/projsu/igcmg/IGCM/ |
---|
13 | |
---|
14 | echo "Voulez vous effectuer les actions listees ci dessus oui/non ?" |
---|
15 | echo -n " Votre reponse : " |
---|
16 | read reponse |
---|
17 | |
---|
18 | case ${reponse} in |
---|
19 | |
---|
20 | oui|OUI|o) |
---|
21 | rsync --omit-dir-times -vrltgoD --progress --chmod=o-w --chmod=g-w --chmod=u-w --delete -e "ssh -ax -o ClearAllForwardings=yes -c blowfish" --exclude='CMIP6/*' --exclude='suivi-de-consomation/*' IGCM/ ${loginCiclad}@ciclad.ipsl.jussieu.fr:/projsu/igcmg/IGCM/ |
---|
22 | ;; |
---|
23 | non|NON|n) |
---|
24 | |
---|
25 | |
---|
26 | echo "Voulez vous sauvegarder la liste des actions dans un fichier oui/non ?" |
---|
27 | echo -n "Votre reponse : " |
---|
28 | read reponse2 |
---|
29 | |
---|
30 | case ${reponse2} in |
---|
31 | |
---|
32 | oui|OUI|o) |
---|
33 | VAR=`date +%Y-%m-%d` |
---|
34 | NAME=`whoami` |
---|
35 | rsync -n --omit-dir-times -vrltgoD --progress --delete -e "ssh -ax -o ClearAllForwardings=yes -c blowfish" --exclude='CMIP6/*' --exclude='suivi-de-consomation/*' IGCM/ ${loginCiclad}@ciclad.ipsl.jussieu.fr:/projsu/igcmg/IGCM/ > /ccc/work/cont003/igcmg/igcmg/TMP_SYNC/liste_action_ciclad_${NAME}_${VAR}.txt |
---|
36 | echo "vous trouverez la liste dans /ccc/work/cont003/igcmg/igcmg/TMP_SYNC/liste_action_ciclad_${NAME}_${VAR}.txt" |
---|
37 | ;; |
---|
38 | non|NON|n) |
---|
39 | ;; |
---|
40 | *) |
---|
41 | echo "Reponse non reconnue" |
---|
42 | ;; |
---|
43 | esac |
---|
44 | |
---|
45 | |
---|
46 | echo "FIN SCRIPT SYNCHRO ! nous passons à la mise à jour des droits " |
---|
47 | ;; |
---|
48 | *) |
---|
49 | echo "Reponse non reconnue" |
---|
50 | ;; |
---|
51 | esac |
---|
52 | |
---|
53 | echo "Mise a jour des droits sur les repertoires de donnees (ciclad), presse entree" |
---|
54 | read pause |
---|
55 | ssh ${loginCiclad}@ciclad.ipsl.jussieu.fr "setfacl -R -m u::rwX,g::rwX,o::r-X /projsu/igcmg/IGCM" |
---|
56 | |
---|
57 | |
---|
58 | |
---|
59 | echo "Verification des droits des repertoires TGCC" |
---|
60 | ccc_shspace_chmod userread /ccc/work/cont003/igcmg/igcmg/IGCM |
---|
61 | is_problem=` ccc_shspace_modck IGCM |grep ccc_shspace_chmod |wc -l` |
---|
62 | if [ "x${is_problem}" != "x0" ] |
---|
63 | then |
---|
64 | echo "Il y a un probleme de droit sur un repertoire qui ne vous appartient pas" |
---|
65 | echo "vous pouvez utiliser la commande ccc_shspace_modck IGCM pour savoir qui doit mettre a jour les droits" |
---|
66 | fi |
---|